netflix-zuul

Spring OAuth2RestTemplate can't obtain new accessToken

旧街凉风 提交于 2019-12-25 11:26:05
问题 I am using spring-boot-oauth2 with authorization_code flow and @EnableZuulProxy .I followed the example from tut-spring-security-and-angular-js with oauth2. I set 60 seconds to access_token_validty for development purpose. Everythings work fine until access token is still valid. But when access token was expired (I waited a moment to expire it), I got exception as below.. WARN SendErrorFilter:78 Error during filtering com.netflix.zuul.exception.ZuulException: Filter threw Exception at com

How to capture log on each instance of the microservice through zuul

耗尽温柔 提交于 2019-12-24 11:13:04
问题 I have setup multiple instances of my microservice and registered to my eureka server. It uses ribbon for client side load balancing and uses zuul as gateway server. All usual stuff. I would like to capture the logs of which instance of my service is responding for each request. So that I can able to bring some conclusion based on my usage of each instances. How to do that? 回答1: You can try to set the loglevel just of the LoadBalancerContext to debug in application.properties #logging logging

Ribbon Retry properties not respected

南楼画角 提交于 2019-12-24 10:35:59
问题 I have a zuul gateway application, that receives requests from a client app and forwards the requests using load balanced rest template to a micro service with 2 endpoints, say endpoint1 and endpoint2 (load balancing between the two end points in round robbin which is okay for now, although I want it to be availability based). Here are the issues I am facing - I brought down one of the end points, say endpoint2 and tried calling the zuul route and I see that when the request is going to the

Fallback methods at Zuul server in Spring cloud

谁说胖子不能爱 提交于 2019-12-24 10:07:24
问题 I am new in Spring Cloud Netflix and have some questions concerning it. I am using the API Gateway together with Hystrix running at Zuul edge server and I would like to make sure if I understand the following behavior correctly: I kill a microservice running "behind" API Gateway then I force hystrix to open the circuit. After that (ca 10 seconds) I send a request to the non-running microservice and receive TIMEOUT error. However when I send many (tens) of requests in a very short time (up to

Redirecting calls using ZuulProxy

依然范特西╮ 提交于 2019-12-24 00:28:34
问题 What I want to do: I would like to have a server that will redirect some kind of calls this way: http://localhost:8080/myapp/api/rest/category/method in http://localhost:8090/category/api/method . What I've done: I've configured my Zuul Proxy like this: info: component: Simple Zuul Proxy Server cloud: conablefig: failFast: true discovery: end: true zuul: routes: api: /myapp/api/rest/** server: port: 8080 logging: level: ROOT: INFO org.springframework.web: INFO info.tcb: DEBUG I'm using a

Netflix Zuul - block request routing

时光毁灭记忆、已成空白 提交于 2019-12-23 13:07:47
问题 With Zuul I can easily define custom filters that are activated before or after the request is forwarded to the specific service. Is there a way to block requests from being forwarded at a "pre" filter level, and send immediately the response to the client? I know something similar is doable with "static" filters, but I need to decide per request (based on the presence of certain parameters/headers in the request itself). 回答1: Here is an example of how I use zuul-filter to check for an API

How to handle Multipart Exception

依然范特西╮ 提交于 2019-12-23 12:17:11
问题 I am building a website for uploading pictures. I am using Spring Boot, eureka and zuul proxy.I am trying to limit the size of the user uploaded pictures. When the picture exceeds the limit it should return some message, but instead it throws a MultipartException . The problem is I don't know how to handle it. I have found a lot of examples on the net, but none of them worked for me. I found an example with servlet filter, but with no luck. I have also tried with ControllerAdvice , yet I

Auto-configure routes with Zuul and Eureka

天大地大妈咪最大 提交于 2019-12-23 05:27:53
问题 Through reading various books / tutorials, it appears that it is possible to auto-configure routes in Zuul when using it in combination with Eureka service discovery. That means that I don't have to explicitly add routes to Zull's application.properties. So I understand this correctly? Or do I still need to add routes explicitly to Zuul in order it to work as a gateway? I would like it to automatically create routes from the application name's that are registered with Eureka. Is this possible

com.netflix.zuul.exception.ZuulException: Forwarding error while calling microservice

戏子无情 提交于 2019-12-23 02:53:34
问题 hi every one , i am getting below exception while calling Microservice. i m using j hipster generated gateway & microservice applications please do need full for issue .i have changed all time out settings still i m not able to call service i am getting below exception while calling Microservice. i m using j hipster generated gateway & microservice applications please do need full for issue .i have changed all time out settings still i m not able to call service com.netflix.zuul.exception

Zuul -> Eureka Server, Basic Authentication issue

谁都会走 提交于 2019-12-22 05:34:29
问题 I am able to hit the service, if the flow doesn't contain Basic Authorization. If i use Basic Authorization, it throws "message": "Full authentication is required to access this resource" Below are my observations: In ZuulFilter, run() method, i get value for request.getHeader("Authorization") --> Basic c29tOnNvbzz== but once it reaches the Micro Service, i am getting value as 'null', request.getHeader("Authorization") --> null Using Spring Boot version : 1.4.0.RELEASE This is my flow: ------