spring-cloud-netflix

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:/

Unable to get /hystrix.stream in Spring Cloud

扶醉桌前 提交于 2019-12-04 07:54:43
I have created a microservice with following dependencies of Spring cloud version Camden.SR2 . Spring Boot 1.4.1. http://localhost:8080/hystrix.stream is not responding. If I make the Spring Cloud version as Brixton.* (RELEASE, SR1,...), I get only ping: as reply in browser. <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId>

Overriding managed version 3.2.0 for bootstrap when put <dependencyManagement>

孤街浪徒 提交于 2019-12-04 05:45:30
问题 when I put <dependencyManagement> getting Overriding managed version 3.2.0 for bootstrap in pom.xml. override dependancies: <dependency> <groupId>org.webjars</groupId> <artifactId>bootstrap-datepicker</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>org.webjars</groupId> <artifactId>datatables</artifactId> <version>1.10.19</version> </dependency> pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3

@EnableFeignClients and @FeignClient fail on Autowiring 'FeignContext' NoSuchBeanException

随声附和 提交于 2019-12-04 02:36:18
The microservice I'm writting needs to communicate to other microservices in our platform. On that attempt, the ideal solution for us is Spring Cloud Netflix Feign , implemeting a @FeignClient . However, I'm facing the exception below when I try an @Autowired ReviewProvider : Exception (cause) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.netflix.feign.FeignContext' available at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:353) at org

Authorization header not passed by ZuulProxy starting with Brixton.RC1

假如想象 提交于 2019-12-03 14:21:21
In switching from Spring Cloud Brixton.M5 to Brixton.RC1 my ZuulProxy no longer passes Authorization headers downstream to my proxied services. There's various actors in play in my setup, but most all of them are fairly simple: - AuthorizationServer: runs separately; hands out JWTs to clients - Clients: get JWTs from OAuth server; each with access to a subset of resources. - ResourceServers: consume JWTs for access decisions - MyZuulProxy: proxies various resource servers; should relay JWTs. It should be noted that MyZuulProxy has no security dependencies whatsoever; It passed the

How to Set Request Headers Using a Feign Client?

一个人想着一个人 提交于 2019-12-03 08:41:37
We are developing a suite of Microservices using Spring Cloud framework and one of the the things that we need to do is to set request headers. I know I can pass a parameter @RequestHeader to a Feign method but the value needs to come from another bean. I don't know if SPEL can be used for a Feign param value. I was thinking that this is a common enough use case for most clients so there'd be some examples, but so far I've not found any. Of course I can dig through the Spring course code and try to override the default Feign configuration but it kinda defeats the purpose of a declarative

Feign: Retry depending on response status

偶尔善良 提交于 2019-12-03 08:21:22
I am currently using Spring Cloud and Feign to consume a Microservice in my application. Since it can happen, that a database connection or the like fails in a single service instance, making it return 500 HTTP status code, I want to make sure, that the next server is retried by the service's clients. Currently, Ribbon's retry mechanism works like a charm when the service is not running at all, however it still returns instantly an error when it receives a 500 status code, without any retry. Is it possible to configure the Feign clients or their underlying Ribbon load balancers to retry the

Load balancer does not have available server for client

﹥>﹥吖頭↗ 提交于 2019-12-03 07:03:10
问题 I'm trying to use Feign client. Below is my feing client: import com.eprogrammerz.examples.domain.Movie; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * Created by Yogen on 12/26/2016. */ @FeignClient(name = "movie-api") public interface MovieApi { @RequestMapping(method = RequestMethod.GET,

How is Spring Cloud Gateway different from Zuul?

眉间皱痕 提交于 2019-12-03 04:04:27
问题 I have been using Zuul as the edge service and API Gateway. Recently I have noticed that Spring Cloud Platform release Spring Cloud Gateway. What is the difference between the two gateways? Why is the Zuul not extended to support the functionalities in S-C-Gateway? What was the driving factor for a new library altogether? When should it be used? 回答1: I am the author of spring cloud gateway. Zuul is built on servlet 2.5 (works with 3.x), using blocking APIs. It doesn't support any long lived

Difference between @RibbonClient and @LoadBalanced

匆匆过客 提交于 2019-12-03 01:31:19
问题 I understand @LoadBalanced indicates the Rest template should be based on Client Side Load Balancing using Ribbon and checks Eureka server for resolving the service name to host/port. What is the use of @RibbonClient . Is it to support native Ribbon Client LB without Eureka and also support Eureka Discover when configured with DiscoveryEnabledNIWSServerList ? 回答1: TL;DR : @LoadBalanced is a marker annotation & @RibbonClient is used for configuration purposes. @LoadBalanced Used as a marker