spring-cloud

I got a “Whitelabel Error Page” when using Eureka server

三世轮回 提交于 2019-12-24 04:40:49
问题 I created a spring cloud project using SPRING INITIALIZR. My project structure is as below: enter image description here The DemoApplication: package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @SpringBootApplication @EnableEurekaServer public class DemoApplication { public static void main(String[] args) { SpringApplication

How to deploy spring cloud microservice on Azure cloud

冷暖自知 提交于 2019-12-24 02:52:37
问题 I am working on micro service development using Spring Cloud and Netflix Eureka. Now I want to deploy these microservices on Azure. I tried to follow this Link but I am not sure that it's a best way to deploy microservices on Azure cloud. Please suggest me what is the best way to deploy these micro service on Azure Cloud? 回答1: Two options You can use Spring-Boot and push it to the docker container, as docker recently launched the support for Azure cloud. You can deploy through Pivotal Cloud

spring-cloud微服务总览

扶醉桌前 提交于 2019-12-24 01:19:53
  Spring Cloud作为当下主流的微服务框架,可以让我们更简单快捷地实现微服务架构。Spring Cloud并没有重复制造轮子,它只是将目前各家公司开发的比较成熟、经得起实际考验的服务框架组合起来,通过Spring Boot风格进行再封装屏蔽掉了复杂的配置和实现原理,最终给开发者留出了一套简单易懂、易部署和易维护的分布式系统开发工具包。Spring Cloud中各个组件在微服务架构中扮演的角色如下图所示,黑线表示注释说明,蓝线由A指向B,表示B从A处获取服务。 由上图所示微服务架构大致由上图的逻辑结构组成,其包括各种微服务、注册发现、服务网关、熔断器、统一配置、跟踪服务等。下面说说Spring Cloud中的组件分别充当其中的什么角色。 Fegin(接口调用):微服务之间通过Rest接口通讯,Spring Cloud提供Feign框架来支持Rest的调用,Feign使得不同进程的Rest接口调用得以用优雅的方式进行,这种优雅表现得就像同一个进程调用一样。 Netflix eureka(注册发现):微服务模式下,一个大的Web应用通常都被拆分为很多比较小的Web应用(服务),这个时候就需要有一个地方保存这些服务的相关信息,才能让各个小的应用彼此知道对方,这个时候就需要在注册中心进行注册。每个应用启动时向配置的注册中心注册自己的信息(IP地址,端口号, 服务名称等信息)

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

How to make GET requests to other Feign clients inside of a POST request?

无人久伴 提交于 2019-12-24 00:23:20
问题 I have a REST API endpoint that makes use of several Feign clients to perform validation and processing. The endpoint in question accepts a POST request, but the Feign clients used for validation accept GET requests. When I make a POST request to my API endpoint I get the error below from the Feign clients that require a GET. I have my Feign clients methods annotated with @GetMapping , but it seems the request is still being sent as a POST. How do I make GET requests to Feign clients inside a

spring cloud auto refresh config server property

廉价感情. 提交于 2019-12-24 00:13:20
问题 I have configured spring cloud config which picks up property from Github. If I post to /refresh , I am also able to get the updated value in my application. Now I want to get properties updated automatically. That means I don't want to hit refresh API to get the changes reflected in my application from Github property file to my application. Do I need to implement Rabbitmq and cloud bus for it or there is any other simple way to do it? Also there document says that we need to add a

Setting up Eureka for non-AWS datacenter

依然范特西╮ 提交于 2019-12-24 00:06:26
问题 I have setup Eureka with 2 peers, after about 5 minutes I see this message appear in the UI: EMERGENCY! EUREKA MAY BE INCORRECTLY CLAIMING INSTANCES ARE UP WHEN THEY'RE NOT. RENEWALS ARE LESSER THAN THRESHOLD AND HENCE THE INSTANCES ARE NOT BEING EXPIRED JUST TO BE SAFE. When I look at the output from one of the running instances of Eureka, I see this: 2015-11-11 14:46:47.276 INFO 32748 --- [pool-5-thread-1] com.netflix.discovery.DiscoveryClient : The response status is 200 2015-11-11 14:56

how to change the @FeignClient name in runtime

你离开我真会死。 提交于 2019-12-23 22:25:03
问题 I use Spring Cloud Netflix to build my micro service . @FeignClient(name = "ms-cloud",configuration = MsCloudClientConfig.class) public interface TestClient { /** * @return */ @RequestMapping(value = "/test", method = RequestMethod.GET) String test(); } I want to change the name to ms-cloud-pre when some special user. Anyone can give some advice? 回答1: According to the documentation feign supports placeholders in the name and url fields. @FeignClient(name = "${store.name}") public interface

How to configure custom Spring Cloud AWS SimpleMessageListenerContainerFactory so it keeps working with @SqsListener

亡梦爱人 提交于 2019-12-23 16:50:32
问题 I am trying to get SpringCloud AWS SQS working with a custom SimpleMessageListenerContainerFactory so i can set timeouts and maxnumber of messages. Without the custom SimpleMessageListenerContainerFactory methods that are annotated with the @SqsListener nicely pickup messages that are in SQS. But when i try to configure a custom SimpleMessageListenerContainerFactory the annotation stops working. @Bean public SimpleMessageListenerContainerFactory simpleMessageListenerContainerFactory

Spring Cloud Config Server without Spring Boot

对着背影说爱祢 提交于 2019-12-23 09:04:11
问题 I have looked at spring-cloud-config client without Spring Boot and many others and have not found a convincing answer. So here it goes again: Question : Is it possible, in a Spring app, to use Spring Cloud Config server/client without the automagic configuration of Spring Boot? Is using Spring Boot a requirement for using these frameworks? If it is: Is there any documentation that clearly describes what needs to be done in order to enable Spring Cloud Config server/client without Spring Boot