spring-cloud

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?

How to implement OAuth2 “Token Exchange” with Spring Cloud Security

ぃ、小莉子 提交于 2019-12-03 11:48:53
问题 I would like to know if someone has an example to see how to implement "Token Exchange" technique with Spring Cloud Security (with OAuth2). Currently I have implemented "Token Relay" technique in a Microservices Environment using ZuulProxy to "relay" the OAuth2 token and implementing SSO. This is great but implies that every microservice uses the same clientId (which is specified in ZuulProxy setup as ZuulProxy relays the token only with authorization_code grant type and the clientId provided

What's the difference between zookeeper vs spring cloud config server?

∥☆過路亽.° 提交于 2019-12-03 10:54:16
What's the difference between zookeeper vs spring cloud config server? They both store configurations in server and make them available to clients. When should one be used over the other? What's the difference between zookeeper vs spring cloud config server? With the Spring Cloud Config Server you have a central place to manage external properties for applications across all environments. The concepts on config server map identically to the Spring Environment and PropertySource abstractions, so they fit very well with Spring applications , but can be used with any application running in any

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

Spring cloud Zuul retry when instance is down and forward to other available instance

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: using 'Camden.SR5' for spring-cloud-dependencies, with spring boot '1.5.2.RELEASE'. In my current setup, I have eureka server config server (running on random ports) zuul gateway server and 2 instances of a service (running on random ports) All these instances are successfully register with Eureka. When all the services are running, The load balancing is done properly through zuul without any issues. when an instance is killed, Zuul is still trying to fulfil the request using the same service which is down. However if waited till the eureka

How to Set Request Headers Using a Feign Client?

一个人想着一个人 提交于 2019-12-03 08:41:37
We are developing a suite of Microservices using Spring Cloud framework and one of the the things that we need to do is to set request headers. I know I can pass a parameter @RequestHeader to a Feign method but the value needs to come from another bean. I don't know if SPEL can be used for a Feign param value. I was thinking that this is a common enough use case for most clients so there'd be some examples, but so far I've not found any. Of course I can dig through the Spring course code and try to override the default Feign configuration but it kinda defeats the purpose of a declarative

Spring-cloud Zuul retry when instance is down

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 选择语言 中文(简体) 日语 英语 中文(繁体) 由 翻译 强力驱动 问题: Using Spring-cloud Angel.SR6: Here is the configuration of my Spring-boot app with @EnableZuulProxy: server . port = 8765 ribbon . ConnectTimeout = 500 ribbon . ReadTimeout = 5000 ribbon . MaxAutoRetries = 1 ribbon . MaxAutoRetriesNextServer = 1 ribbon . OkToRetryOnAllOperations = true zuul . routes . service - id . retryable = true I have 2 instances of service-id running on random ports. These instances, as well as the Zuul instance, successfully register with Eureka, and I can access RESTful endpoints on

How can I change the feign URL during the runtime?

橙三吉。 提交于 2019-12-03 08:21:40
@FeignClient(name = "test", url="http://xxxx") How can I change the feign URL (url="http://xxxx") during the runtime? because the URL can only be determined at run time. Sandip Nirmal Feign has a way to provide the dynamic URLs and endpoints at runtime. The following steps have to be followed: In the FeignClient interface we have to remove the URL parameter. We have to use @RequestLine annotation to mention the REST method (GET, PUT, POST, etc.): @FeignClient(name="customerProfileAdapter") public interface CustomerProfileAdaptor { // @RequestMapping(method=RequestMethod.GET, value="/get_all")

Feign: Retry depending on response status

偶尔善良 提交于 2019-12-03 08:21:22
I am currently using Spring Cloud and Feign to consume a Microservice in my application. Since it can happen, that a database connection or the like fails in a single service instance, making it return 500 HTTP status code, I want to make sure, that the next server is retried by the service's clients. Currently, Ribbon's retry mechanism works like a charm when the service is not running at all, however it still returns instantly an error when it receives a 500 status code, without any retry. Is it possible to configure the Feign clients or their underlying Ribbon load balancers to retry the

Spring cloud: Ribbon and HTTPS

不羁岁月 提交于 2019-12-03 07:28:42
问题 We want to use HTTPS for our microservices communication based on Feign and Ribbon. The services are based on spring boot and tomcat is correctly setup. The instances are registered with the HTTPS URL and securePort enabled on Eureka. However, when we call another microservice via Feign then the underlying Ribbon doesn't recognizes the protocol and falls back to HTTP. I could solve that problem by adding the protocol to the FeignClient annotation like this: @FeignClient("https://users") But