netflix

Can Zuul Edge Server be used without Eureka / Ribbon

有些话、适合烂在心里 提交于 2019-12-03 12:27:40
问题 We have an infrastructure with service discovery and load balancing (i.e. server side with STM and weblogic cluster). Now we are in the process of refactoring into micro-services. We would need an API gateway which does basic routing to other microservices. Netflix Zuul looks a good candidate however I could not get Zuul working without Eureka - but we do not need Eureka since we already have service discovery and load balancing in place. Is it possible to use Zuul without Eureka and Ribbon?

Zuul 1.x 的工作原理

大憨熊 提交于 2019-12-03 12:02:43
Zuul简介 Zuul在微服务架构中,可以作为提供动态路由,监控,弹性,安全等边缘服务的框架。在Netflix,被用作所有请求到达 streaming application 的前门。Zuul使用一系列不同的 Filter 可以提供各种功能: 安全与认证 监控 动态路由 压测 限流 静态响应 多区域弹性负载均衡 可参考: How We Use Zuul At Netflix Zuul执行流程 先从github把代码clone下来: git clone https://github.com/Netflix/zuul.git ,切换至 1.x 分支,核心代码为 zuul-core 模块,几个重要的类清单如下: 类名 描述 RequestContext 继承至ConcurrentHashMap;被保存在ThreadLocal中;单例 ZuulServlet 继承至HttpServlet;核心方法为service() ZuulFilter 抽象类,实现了Comparable接口,自定义Filter需从它继承 ZuulRunner ZuulServlet中用于代为执行route方法;核心方法为init(),初始化RequestContext中的request, response FilterProcessor Filter执行器

Unexplainable lack of performance improvement using RxJava Observables in Web Applications

拥有回忆 提交于 2019-12-03 10:38:05
I am performing some tests to evaluate if there is a real advantage in using reactive API's based on Observables, instead of the blocking traditional ones. The whole example is available on Githug Surprisingly the results show that the thoughput results are: The best : REST Services that return a Callable / DeferredResult that wraps the blocking operations. Not that bad : Blocking REST Services. The worst : REST Services that return a DeferredResult whose result is set by a RxJava Observable . This is my Spring WebApp: Application : @SpringBootApplication public class SpringNioRestApplication

NetflixOSS Zuul Filter for rejecting requests

非 Y 不嫁゛ 提交于 2019-12-03 10:21:50
I am trying to use a ZuulFilter in a simple spring-cloud-Netflix Api gateway (reverse proxy) in order to authenticate requests against a custom authentication provider (via Rest call). The Filter should reject unauthorized requests with a 401 and don't pass those requests further down to the proxied services. Is that even possible for a ZuulFilter? I did not find documentation, example or something in Zuuls api. Any suggestions? I got this to work, took some digging. Make sure your request isn't cached already. Just call this method from your run() method inside your ZuulFilter. /** * Reports

Replicate Netflix login and generate cookie

送分小仙女□ 提交于 2019-12-03 09:07:20
Since there is no official public Netflix API anymore, I'm trying to reverse engineer some things on my own. But I'm kind of stuck at the login. What I'm doing: GET request on https://www.netflix.com/Login Follow the redirects to end up on something like /Login?locale=en-DE Extract the authURL value (required for the login POST later on) GET request on https://assets.nflxext.com/us/ffe/siteui/logging/clientNotifications.min.20150626.js [Failed] Generate and set the "cL" cookie from the content of that JavaScript POST request on https://www.netflix.com/Login?locale=en-DE using the following

springcloud中config启动时候报错Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'config.info' in value \"${config.info}\"

﹥>﹥吖頭↗ 提交于 2019-12-03 07:14:55
"C:\Program Files\Java\jdk1.8.0_191\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=2692 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\Program Files\JetBrains\ideaIU-2018.1.2.win\lib\idea_rt.jar=2693:D:\Program Files\JetBrains\ideaIU-2018.1.2.win\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_191\jre

Can Zuul Edge Server be used without Eureka / Ribbon

北慕城南 提交于 2019-12-03 01:57:49
We have an infrastructure with service discovery and load balancing (i.e. server side with STM and weblogic cluster). Now we are in the process of refactoring into micro-services. We would need an API gateway which does basic routing to other microservices. Netflix Zuul looks a good candidate however I could not get Zuul working without Eureka - but we do not need Eureka since we already have service discovery and load balancing in place. Is it possible to use Zuul without Eureka and Ribbon? If yes please provide some guild-lines since the there's no mention about in the wiki. Thanks. Yes, it

自定义Ribbon客户端策略

社会主义新天地 提交于 2019-12-03 01:25:41
说明   为了实现Ribbon细粒度的划分,让调用不同的微服务时采用不同的客户端负载均衡策略, 通常情况下我们会自定义配置策略。   本文以内容中心(content-center)调用户中心微服务(user-center)为例子进行演示 内容中心包结构如下图所示: 版本选择 Spring Boot Spring Cloud Spring Cloud Netflix Ribbon 2.1.5.RELEASE Greenwich.SR3 2.1.3.RELEASE 方式一、通过Java代码配置 RandomConfiguration.java package ribbonconfiguration; import com.netflix.loadbalancer.IRule; import com.netflix.loadbalancer.RandomRule; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * description: 随机的负载均衡策略 * jdk: 1.8 */ @Configuration public class RandomConfiguration { @Bean

Spring Cloud 之 Zuul 服务网关Gateway

匿名 (未验证) 提交于 2019-12-03 00:41:02
zuul 是netflix开源的一个API Gateway 服务器, 本质上是一个web servlet应用。 Zuul 在云平台上提供动态路由,监控,弹性,安全等边缘服务的框架。Zuul 相当于是设备和 Netflix 流应用的 Web 网站后端所有请求的前门。 Gateway(网关)是微服务架构的不可获取的一个部分,Gateway为客户点提供了统一访问的入口,Netflix Zuul是 Spring Cloud默认使用的Gateway组件 Zuul是Netflix出品的一个路由和服务端的负载均衡组件 1、打开idea新建springBoot项目 创建完成项目后,可以发现pom.xml文件中的这两个依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-zuul</artifactId> </dependency> 2、在项目的主类上添加注解

Spring Cloud Netflix

匿名 (未验证) 提交于 2019-12-03 00:22:01
该项目通过自动配置为Spring Boot应用程序提供Netflix OSS集成,并绑定到Spring环境和其他Spring编程模型成语。 通过几个简单的注释,您可以快速启用和配置应用程序中的常见模式,并通过经过测试的Netflix组件构建大型分布式系统。 提供的模式包括服务发现(Eureka),断路器(Hystrix),智能路由(Zuul)和客户端负载平衡(Ribbon)。 服务发现:Eureka客户端 服务发现是基于微服务架构的关键原则之一。 尝试配置每个客户端或某种形式的约定可能非常困难,可以非常脆弱。 Netflix服务发现服务器和客户端是Eureka。 可以将服务器配置和部署为高可用性,每个服务器将注册服务的状态复制到其他服务器。 如何包含Eureka客户端 要在您的项目中包含Eureka客户端,请使用组 org.springframework.cloud spring-cloud-starter-eureka 的启动器。 有关 使用当前的Spring Cloud发布列表设置构建系统的详细信息 。 注册Eureka 当客户端注册Eureka时,它提供关于自身的元数据,例如主机和端口,健康指示符URL,主页等。Eureka从属于服务的每个实例接收心跳消息。 如果心跳失败超过可配置的时间表,则通常将该实例从注册表中删除。 示例eureka客户端: @Configuration