netflix-zuul

Zuul dynamic routing

醉酒当歌 提交于 2019-12-12 04:39:45
问题 I am trying to use Zuul as an API Gateway, in one particular scenario I have to change URL, based on data coming from client. I can do most of the things using "pre" filter but so far I'm unable to read the configured URL in the route. This is how my route looks like: zuul: #prefix: /api sensitive-headers: Cookie,Set-Cookie,Authorization routes: mgmt: path: /test/abc/mgmt/** url: https://myserver:8080/{id}/ I want to replace id from from data received from client. As of now I am unable to

Eureka with AWS ECS

不问归期 提交于 2019-12-12 04:36:09
问题 We are using Eureka with AWS ECS service that can scale docker containers. In ECS if you leave out the host port, or specify it as being '0', in your task definition, then the port will be chosen automatically and reported back to the service. After the task is running, describing it should show what port(s) it bound to. How does Eureka can resolve what port to use if we have several EC2 instance. For example Service A from EC2-A try to call Service B from EC2-B. So Eureka can resolve

How to get username from JWT token while requesting for another service after authentication?

不打扰是莪最后的温柔 提交于 2019-12-11 17:23:04
问题 I am developing a spring boot application having front end with angular6 and using Eureka for service registry and zuul for authentication gateway, both as separate service. I am using jwt for authentication. When I hit the url localhost:8080/dis/academics/complaint/getMyComplaints with authorization header having value jwt token, then it goes to gateway service and then gateway forwards this to academics service after valid authentication at gateway. Now I want to get username from token in

Cannot get JWT Token from Zuul Header in Spring Boot Microservice Module

一世执手 提交于 2019-12-11 17:05:18
问题 I have tried to send JWT Token in Zuul Header to another microservice module. Each Time request goes from zuul to another module but. I always get null header in another module. But I obtain token in zuul server from auth server but it never reaches to another module. public class JwtTokenAuthenticationFilter extends OncePerRequestFilter { private final JwtConfig jwtConfig; public JwtTokenAuthenticationFilter(JwtConfig jwtConfig) { this.jwtConfig = jwtConfig; } private static final int FILTER

Why won´t Spring Security 5 redirect back to protected resource after login?

坚强是说给别人听的谎言 提交于 2019-12-11 14:25:55
问题 After upgrading our authentication server from Spring Boot 1.5.13 to 2.1.3 it stopped redirecting after successful logins. It tries to reload the /login page now. I created a web site, proxy server and authentication service in GitHub to demonstrate the problem. For this integration test, create a PCF Space that includes a service registry and these micro-services: Angular Example - If you bypass the proxy and go to the angular example route the page loads. TRY IT. Authentication Example - If

micro-service: Zuul & consul require authentification

本秂侑毒 提交于 2019-12-11 10:33:44
问题 I'm trying to create a Spring cloud microservice application using Zuul and Consul. I have 2 components in my project: api-gateway microservice using Zuul Hello world microservice (a simple hello world Rest Webservice) Here is the code of The api-gateway: @SpringBootApplication @EnableZuulProxy @EnableDiscoveryClient public class ZuulApplication { public static void main(String[] args) { SpringApplication.run(ZuulApplication.class, args); } } The pom.xml <parent> <groupId>org.springframework

Adding a new field to body of the request from Netflix Zuul Pre-filter

本小妞迷上赌 提交于 2019-12-11 07:57:55
问题 I'm trying to add a new field to request's body, in a Zuul Pre-filter. I'm using one of the Neflix's Zuul sample projects from here, and my filter's implementation is very similar to UppercaseRequestEntityFilter from this sample. I was able to apply a transformation such as uppercase, or even to completely modify the request, the only inconvenient is that I'm not able to modify the content of body's request that has a length more than the original length of the body's request. This is my

Spring Boot - Force All Traffic to Come Through Gateway Service

萝らか妹 提交于 2019-12-11 07:03:42
问题 In our domain, we have a number of Spring Boot applications and a Gateway Service (we are using Netflix Zuul). Our Gateway Service is handling our authentication and security. We expect all of our consumers to be coming in through our Gateway Service. Because the security is being handled by the Gateway Service, we'd like to disable direct access to our Spring Boot applications. Any requests made that didn't originate from our Gateway Service should be rejected. How can we accomplish this in

spring-cloud-zuul timeout configuration does not work

我怕爱的太早我们不能终老 提交于 2019-12-11 05:25:50
问题 according to spring cloud zuul 8.1.3 zuul timeout, the following configuration should make zuul timeout after 20 seconds, however, it times out at 10 seconds. server: port: 8769 spring: application: name: service-zuul zuul: host: connect-timeout-millis: 20000 socket-timeout-millis: 60000 zuul: routes: tp: path: /** url: http://localhost:9998 ribbon:eureka:enabled: false From console output one can see that the interval between filter and timeout exception is only 10 seconds. which means the

com.netflix.zuul.exception.ZuulException: Hystrix Readed time out

假装没事ソ 提交于 2019-12-11 04:57:24
问题 I am trying microservices with eureka and zuul. And there is a problem with all requests, which take more then 1 second. As I have understood, 1 second is default hystrix timeout, and for configuring timeouts in Zuul, I have to configure these properties: hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds ribbon.ConnectTimeout ribbon.ReadTimeout but when I set them, there is "Cannot resolve configuration property ..." warning on each of them in the Intelije Idea. And, it