netflix-zuul

tls mutual authentication between zuul and microservice with certificates

若如初见. 提交于 2020-01-24 00:04:08
问题 I have a zuul proxy acting as an edge server and my microservices are non jvm applications and I dont use ribbon or eureka. These microservices are accessible over https only and require client certs to communicate with them. Does zuul support mutual auth with certs for downstream? If so how do i set it up on my zuul server. 回答1: If you're using Spring Cloud Zuul, you can provide your own Http Client by define CloseableHttpClient bean like below. (supported from Edgware release) @Bean public

tls mutual authentication between zuul and microservice with certificates

断了今生、忘了曾经 提交于 2020-01-24 00:04:02
问题 I have a zuul proxy acting as an edge server and my microservices are non jvm applications and I dont use ribbon or eureka. These microservices are accessible over https only and require client certs to communicate with them. Does zuul support mutual auth with certs for downstream? If so how do i set it up on my zuul server. 回答1: If you're using Spring Cloud Zuul, you can provide your own Http Client by define CloseableHttpClient bean like below. (supported from Edgware release) @Bean public

Spring Boot + Cloud | Zuul Proxy | Integration testing

大城市里の小女人 提交于 2020-01-22 17:54:47
问题 When working with Spring Boot to build micro-services its very easy to write extensive and very readable integration tests and mock remote service requests with MockRestServiceServer . Is there a way to use similar approach to perform additional integration test on ZuulProxy ? What I would like to achieve is being able to mock remote servers that ZuulProxy would forward to and validate that all of my ZuulFitler s behaved as expected. However, ZuulProxy is using RestClient from Netflix

How to get response body in Zuul post filter?

流过昼夜 提交于 2020-01-21 04:17:27
问题 How it is possible to read a response body while using Zuul as a proxy in post filter? I am trying to call the code like this: @Component public class PostFilter extends ZuulFilter { private static final Logger log = LoggerFactory.getLogger(PostFilter.class); @Override public String filterType() { return "post"; } @Override public int filterOrder() { return 2000; } @Override public boolean shouldFilter() { return true; } @Override public Object run() { RequestContext ctx = RequestContext

Timeout Exception in Zuul based routing

≡放荡痞女 提交于 2020-01-14 10:34:15
问题 I have got the below setup in which my Eureka server is running and few services created and registered with Eureka are running. All the service to service calls are happing using rest template which has been load balanced and every thing is working fine. Now, I have introduced the Zuul based routing to the application with below code/properties - @SpringBootApplication @EnableZuulProxy public class ApiGatewayApplication { public static void main(String[] args) { SpringApplication.run

Timeout Exception in Zuul based routing

▼魔方 西西 提交于 2020-01-14 10:34:06
问题 I have got the below setup in which my Eureka server is running and few services created and registered with Eureka are running. All the service to service calls are happing using rest template which has been load balanced and every thing is working fine. Now, I have introduced the Zuul based routing to the application with below code/properties - @SpringBootApplication @EnableZuulProxy public class ApiGatewayApplication { public static void main(String[] args) { SpringApplication.run

How to make Zuul dynamic routing based on HTTP method and resolve target host by 'serviceId'?

五迷三道 提交于 2020-01-13 03:39:40
问题 How to make Zuul dynamic routing based on HTTP method (GET/POST/PUT...)? For example, when you need to route the POST request to the different host instead of the default one described in ' zuul.routes.* '... zuul: routes: first-service: path: /first/** serviceId: first-service stripPrefix: false second-service: path: /second/** serviceId: second-service stripPrefix: false I.e. when we request ' GET /first ' then Zuul route the request to the ' first-service ', but if we request ' POST /first

How to pass modified/wrapped HTTPServletRequest to subsequent Zuul Filters?

一曲冷凌霜 提交于 2020-01-11 11:52:30
问题 We have a Zuul Pre-Filter (Filter1) which will inspect the incoming HTTPServletRequest and make some changes to the query parameters in it to embed it to a custom created request (wrapping HttpServletRequestWrapper). Now, i want to pass this custom wrapped request to the next Zuul Pre-Filter (Filter2). How can i do that ? Earlier when using regular Servlet Filters, we use as following in my Filter1 chain.doFilter(new CustomRequestWrapper(request, extra), response); but, in Zuul Filter, the

Adding Headers to Zuul when re-directing

ぃ、小莉子 提交于 2020-01-11 08:48:14
问题 I am trying to use Zuul to redirect calls to a downstream system somewhere else. In the re-direct, I need to add in a Header with necessary data for the api receiving the redirection to process. I can't seem to get the downstream system to detect this data. Attached is my code. I am using Zuul from Edgware.SR3, Spring Boot 1.5.12 Zuul Filter @Component public class RouteFilter extends ZuulFilter{ @Override public Object run() { //Testing to add header context.getRequest().getParameterMap()

Unable to access Jhipster generated micro services on jhipster-registry in Aws Elastic Beanstalk

倾然丶 夕夏残阳落幕 提交于 2020-01-07 05:34:11
问题 I deployed my gateway, microservices and jhipster-registry applications on Aws Elastic Beanstalk. Applications are registered successfully on the registry. I am able to access the UI as well however when I try to access the api's it throws the below error: I can see the microservices app in the gateway as well. When I try to access the applications by clicking on the links inside registry I get server DNS address could not be found . Any idea what I am doing wrong here? Everything works fine