spring-cloud-netflix

Spring MVC web app behind zuul redirect issue

五迷三道 提交于 2020-02-01 04:39:46
问题 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:/

Failed to start bean 'eurekaAutoServiceRegistration'; casued by No Scope registered for scope name 'refresh'

本秂侑毒 提交于 2020-01-25 07:53:47
问题 Failed to start bean eurekaAutoServiceRegistration caused by No Scope registered for scope name 'refresh' @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class }) @EnableDiscoveryClient public class WebRun extends SpringBootServletInitializer { public SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(WebRun.class); } public static void main(String[] args) { SpringApplication.run(WebRun

Spring Cloud : Load Message Sources from config server

空扰寡人 提交于 2020-01-14 14:45:29
问题 I'm working on Spring cloud project (Spring Boot + Eureka API ) that contains client , registry and a config server , so I need to load Message properties from the config Server : I have already a config server with application.properties well configured and available from client server . My current MessageSource Bean in the client Micro-service: @Configuration public class Config { @Bean public ReloadableResourceBundleMessageSource messageSource() { ReloadableResourceBundleMessageSource

org.eclipse.jgit.api.errors.InvalidRemoteException: Invalid remote: origin - Spring Cloud

陌路散爱 提交于 2020-01-14 05:42:09
问题 I am working on Spring Boot Cloud using GIT. Using Spring Boot 2.2.2.RELEASE version. SpringBootCloudChap2ConfigServerGitApplication.java @SpringBootApplication @EnableConfigServer @EnableAutoConfiguration public class SpringBootCloudChap2ConfigServerGitApplication { public static void main(String[] args) { SpringApplication.run(SpringBootCloudChap2ConfigServerGitApplication.class, args); } } application.properties server.port=8888 spring.cloud.config.server.git.uri=https://github.com

How to make Zuul dynamic routing based on HTTP method and resolve target host by 'serviceId'?

五迷三道 提交于 2020-01-13 03:39:40
问题 How to make Zuul dynamic routing based on HTTP method (GET/POST/PUT...)? For example, when you need to route the POST request to the different host instead of the default one described in ' zuul.routes.* '... zuul: routes: first-service: path: /first/** serviceId: first-service stripPrefix: false second-service: path: /second/** serviceId: second-service stripPrefix: false I.e. when we request ' GET /first ' then Zuul route the request to the ' first-service ', but if we request ' POST /first

Eureka not able to find port when running microservices on random port

孤者浪人 提交于 2020-01-06 04:09:48
问题 I am using eureka for service discover and ribbon for load balancing in my spring boot application. When i run my micro services which are registered with eureka on a fix port it works fine but when i run them on random port though i can see services registered on eureka dashboard it is not able to find the port number. and i get the following error when trying to hit the service. 2018-11-27 07:55:15.853 INFO 7240 --- [nio-8079-exec-1] c.n.l.DynamicServerListLoadBalancer :

NullPointerException in LoadBalancerFeignClient (spring-cloud-netflix)

独自空忆成欢 提交于 2020-01-04 17:45:31
问题 We are using Feign for our clients in our services. Recently one of the services started to randomly throw some exceptions which is caused by: Caused by: java.lang.NullPointerException: null at org.springframework.cloud.netflix.feign.ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:63) at org.springframework.cloud.sleuth.instrument.web.client.feign.TraceLoadBalancerFeignClient.execute(TraceLoadBalancerFeignClient.java:41) at feign.SynchronousMethodHandler.executeAndDecode

spring-boot Autowired DiscoveryClient RestTemplate UnknownHostException

流过昼夜 提交于 2020-01-02 06:52:10
问题 I'm using spring boot 1.3.3 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> Edit I'm using Brixton.RC1 for my spring cloud dependencies <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Brixton.RC1</version> <type>pom</type> <scope

Spring cloud Zuul retry when instance is down and forward to other available instance

你。 提交于 2020-01-02 04:01:32
问题 using 'Camden.SR5' for spring-cloud-dependencies, with spring boot '1.5.2.RELEASE'. In my current setup, I have eureka server config server (running on random ports) zuul gateway server and 2 instances of a service (running on random ports) All these instances are successfully register with Eureka. When all the services are running, The load balancing is done properly through zuul without any issues. when an instance is killed, Zuul is still trying to fulfil the request using the same service

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

懵懂的女人 提交于 2020-01-01 12:10:30
问题 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)