netflix-zuul

Heroku load balancer vs Netflix zuul

空扰寡人 提交于 2019-12-06 02:16:34
问题 According to this answer https://stackoverflow.com/a/41811770/2849613 I would like to get a little bit more information about best practices with microservices on Heroku. The question is which approach is better? Install every services as independent app, and use one of them as REST "proxy" (for example Netflix Eureka)? Or Create docker based approach with, for example Netflix Zuul as a load balancer? On my own I see already some pros and cons of both approaches: Pros : better scalability

Spring redirect url issue when behind Zuul proxy

烈酒焚心 提交于 2019-12-05 20:27:17
问题 I've been trying to get to the bottom of a strange redirection issue for the past 2 days without success. Based on the spring-cloud example projects, I've configured Eureka, Zuul and a basic service that runs behind Zuul. I have the following method; @RequestMapping(method = RequestMethod.POST, value = "/register") public String registerDevice(Principal principal, String response) { // ... return "redirect:/account"; } The form is setup to post to the proxied URL as follows; POST https:/

Uploading large files via Zuul

别说谁变了你拦得住时间么 提交于 2019-12-05 04:54:41
I've faced a problem uploading big files through zuul. I'm using apache-commons file upload( https://commons.apache.org/proper/commons-fileupload/ ) to stream large files as well as I use zuul on the front. In my Spring Boot application I have disabled upload provided by Spring to use the one from apache commons: spring: http: multipart: enabled: false Controller looks like that: public ResponseEntity insertFile(@PathVariable Long profileId, HttpServletRequest request) throws Exception { ServletFileUpload upload = new ServletFileUpload(); FileItemIterator uploadItemIterator = upload

NetflixOSS Zuul Filter for rejecting requests

南笙酒味 提交于 2019-12-04 16:16:43
问题 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? 回答1: I got this to work, took some digging. Make sure your

Spring Zuul: Dynamically disable a route to a service

北慕城南 提交于 2019-12-04 16:06:04
I'm trying to disable a Zuul route to a microservice registered with Eureka at runtime (I'm using spring boot). This is an example: localhost/hello localhost/world Those two are the registered microservices. I would like to disable the route to one of them at runtime without shutting it down. Is there a way to do this? Thank you, Nano Alternatively to using Cloud Config, custom ZuulFilter can be used. Something like (partial implementation to show the concept): public class BlackListFilter extends ZuulFilter { @Override public String filterType() { return "pre"; } ... @Override public Object

Implementing authentication and authorization using Zuul Proxy, Oauth2 on REST Microservices

喜夏-厌秋 提交于 2019-12-04 14:32:41
问题 I am trying to implement the above architecture in the workflow with Spring Boot. Web client makes a request to Resource Server (Microservices Endpoints) through Zuul Proxy. Zuul Proxy redirects to oauth2 server for authentication. Oauth2 redirects to Zuul Proxy if the request is authenticated or not. If not authenticated, Zuul redirects Web client with an unauthenticated response. If Authenticated, Zull proxy redirects to the requested microservice endpoint. Microservice endpoint checks if

Combining Netflix Zuul with Netflix Hystrix

孤人 提交于 2019-12-04 13:44:37
I'm a big fan of the Open Source project of Netflix. They made some really cool stuff. I have set up a Zuul and that is working fine. Created all kind of filters and those are dynamically loaded and run. What I now try to do is use Hystrix inside a filter. What I see is that if everything when fine it all works. But when there is a exception inside the run() method Zuul is catching it instead of Hystrix. So the getFallback() is never called. I shared my code Github . Somebody has any idea how Hystrix can catch the exception instead of Zuul? I think the issue is actually with how you are

Spring Cloud Zuul API gateway doesn't forward JWT token for stateless sessions

寵の児 提交于 2019-12-04 10:53:58
I am trying to implement Microservices architecture backend using Spring Boot 1.5.6.RELEASE and Spring Cloud Dalston.SR3 that would be consumed by mobile/web endpoints. API Gateway application @SpringBootApplicatio @EnableEurekaClient @EnableZuulProxy public class GatewayApplication { public static void main(String[] args) { SpringApplication.run(GatewayApplication.class, args); } } API security @Configuration @EnableWebSecurity @Order(ManagementServerProperties.ACCESS_OVERRIDE_ORDER) @EnableOAuth2Sso public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { @Override public

Setting the route programmatically in Spring Cloud Netflix Zuul

冷暖自知 提交于 2019-12-04 09:27:34
I have created two AWS Beanstalk envs, each with their own version of the applications. The urls for these envs are https://beta.myserver.com/v1073 and https://beta.myserver.com/v1084 . These urls point to the load balancer. Now I also have a Zuul implementation that have the following configurations. zuul: routes: beta: path: /api/** serviceId: beta-root strip-prefix: false sensitive-headers: Cookie,Set-Cookie ribbon: eureka: enabled: false hystrix: command: default: execution: isolation: thread: timeoutInMilliseconds: 5000 beta-root: ribbon: listOfServers: https://beta.myserver.com Request

Spring MVC web app behind zuul redirect issue

喜欢而已 提交于 2019-12-04 08:30:01
I have a set of Spring Boot (1.3.3) with Spring Cloud (Brixton.RC2) microservices running behind Zuul and I have issues with my urls being rewritten in redirects. My main issue is that my web app is behind zuul and seems to be unaware of host during redirects even though I should have set all necessary properties. When I go to http://test.example.com/ I expect to be redirected to http://test.example.com/login but I get redirected to http://machinehostname/login ... If I go directly to http://test.example.com/login I can see my login form and login but then get redirected to http:/