netflix-zuul

Zuul and Ribbon integration

人走茶凉 提交于 2019-11-29 16:59:31
问题 I have trouble understanding the connection between Zuul and Ribbon. I think I got Zuul clear. It's a reverse proxy I can contact to reach one of my several instances of a service. It will pick the right server using a round-robin algorithm or whatever you configure it to do. It's a traditional load-balancer. To know the instances available it can use a registry like Eureka. But I've got more trouble with Ribbon. It's sold as a client-side load balancer but what does it mean ? It doesn't need

Spring OAuth Authorization Server behind Spring Cloud Zuul Proxy

[亡魂溺海] 提交于 2019-11-28 16:00:28
I am currently developing a application based on a micro service architecture. We use a API-Gateway implemented using Spring Cloud Netfix's Zuul Server to route the requests to our micro services. To realize single sign on for all our services I am currently working on an OAuth2 server set up using Spring Cloud Security. The server is basically just copy and past of the implementation in Dave Syer's Repo: https://github.com/dsyer/spring-security-angular/tree/master/oauth2/authserver The main difference is that I want to route the requests to my OAuth server through the Zuul Proxy. This way I

How to forward to different path using netflix zuul?

只谈情不闲聊 提交于 2019-11-28 11:58:09
问题 I'm using netflix zuul embedded in a spring boot 1.5.x application. Behind zuul are some microservices. These microservices expose public endpoints under /public/** . Now i want to expose these public endpoints via zuul api gateway but stripping the "/public" out of the final api gateway url. Example (expected) from outside (request through zuul api gateway): api.yourdomain.tld/path/to/service/endpoint Zuul should forward this request to (with /public in the url): service:{port}/public/path

Using Zuul as an authentication gateway

故事扮演 提交于 2019-11-28 03:24:10
Background I want to implement the design presented in this article . It can be summarised by the diagram below: The client first authenticate with the IDP (OpenID Connect/OAuth2) The IDP returns an access token (opaque token with no user info) The client makes a call through the API gateway use the access token in the Authorization header The API gateway makes a request to the IDP with the Access Token The IDP verifies that the Access Token is valid and returns user information in JSON format The API Gateway store the user information in a JWT and sign it with a private key. The JWT is then

Spring OAuth Authorization Server behind Spring Cloud Zuul Proxy

淺唱寂寞╮ 提交于 2019-11-27 19:50:41
问题 I am currently developing a application based on a micro service architecture. We use a API-Gateway implemented using Spring Cloud Netfix's Zuul Server to route the requests to our micro services. To realize single sign on for all our services I am currently working on an OAuth2 server set up using Spring Cloud Security. The server is basically just copy and past of the implementation in Dave Syer's Repo: https://github.com/dsyer/spring-security-angular/tree/master/oauth2/authserver The main

How do you create custom zuul filters in spring cloud

纵饮孤独 提交于 2019-11-27 15:13:51
I want to write some of my own custom zuul filters for a spring cloud microservice i am writing. Once i have the filter written how do I integrate it so the underlying netflix zuul framework can take advantage of it. Create a @Bean that extends ZuulFilter . See java configuration examples here . As long as the bean is in the same context as the @EnableZuulProxy app, it will automatically get picked up. @Bean public MyFilter myFilter() { return new MyFilter(); } See examples of filters here . public class MyFilter extends ZuulFilter { //... } There are three types of filters: pre, route and

Customizing Zuul Exception

时间秒杀一切 提交于 2019-11-27 04:25:09
I have a scenario in Zuul where the service that the URL is routed too might be down . So the reponse body gets thrown with 500 HTTP Status and ZuulException in the JSON body response. { "timestamp": 1459973637928, "status": 500, "error": "Internal Server Error", "exception": "com.netflix.zuul.exception.ZuulException", "message": "Forwarding error" } All I want to do is to customise or remove the JSON response and maybe change the HTTP status Code. I tried to create a exception Handler with @ControllerAdvice but the exception is not grabbed by the handler. UPDATES: So I extended the Zuul

Creating custom Zuul filters

怎甘沉沦 提交于 2019-11-27 02:59:17
问题 I want to implement custom filters for my Zuul proxy. Now, I know there has been a lot of talking about that subject here and I took a look at the answer provided, with the examples of filters and the Spring Cloud documentation, which I went through several times. I have tried to copy some of the filters content to my use, but it didn't work. I have a Eureka server, registering 3 separate services, one of them being the front door to the other two, collecting information from each of them and

Using Zuul as an authentication gateway

元气小坏坏 提交于 2019-11-27 00:02:46
问题 Background I want to implement the design presented in this article. It can be summarised by the diagram below: The client first authenticate with the IDP (OpenID Connect/OAuth2) The IDP returns an access token (opaque token with no user info) The client makes a call through the API gateway use the access token in the Authorization header The API gateway makes a request to the IDP with the Access Token The IDP verifies that the Access Token is valid and returns user information in JSON format

Customizing Zuul Exception

雨燕双飞 提交于 2019-11-26 17:28:19
问题 I have a scenario in Zuul where the service that the URL is routed too might be down . So the reponse body gets thrown with 500 HTTP Status and ZuulException in the JSON body response. { "timestamp": 1459973637928, "status": 500, "error": "Internal Server Error", "exception": "com.netflix.zuul.exception.ZuulException", "message": "Forwarding error" } All I want to do is to customise or remove the JSON response and maybe change the HTTP status Code. I tried to create a exception Handler with