spring-cloud

Eureka detect service status

孤街醉人 提交于 2019-12-08 01:16:06
问题 Context We are using Spring Cloud Netflix with Eureka as the service discovery and Zuul for proxying the services and load balance them. The microservices are implemented using NodeJS and are registered at Eureka using the NPM module eureka-js-client and a custom layer in between that handles the configuration and stuff that is generic for all microservices. Problem The problem is that Eureka does not recognize if one service goes down. This is a problem as we are having a development

Spring Cloud Config port conflict

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 23:56:29
问题 I started playing around with the spring cloud code here: https://github.com/spring-cloud/spring-cloud-config and I tried to run the server and client on the same host. However I keep getting an error (below) which claims that the address is already in use. The server should run on port 8888 by default, so is it not possible for both the client and the server to run on the same host? I'm basically trying to answer this question, but I'm running into this port problem on the way: Spring-Cloud

Spring cloud体系及使用

荒凉一梦 提交于 2019-12-07 23:42:31
SpringCloud体系介绍 Spring Cloud Netflix Netflix Eureka:服务治理组件,包含服务注册与发现 Netflix Ribbon:客户端负载均衡的服务调用组件 Netflix Hystrix:容错管理组件,实现了熔断器 Netflix Feign:基于Ribbon和Hystrix的声明式、模板化的HTTP服务调用组件 Netflix Zuul:网关组件,提供智能路由、访问过滤等功能 Netflix hystrix-dashboard:单个服务监控 Netflix Turbine:Turbine是聚合服务器发送事件流数据的一个工具,用来监控集群下hystrix的metrics情况。 Netflix Archaius:外部化配置组件 ... Spring Cloud Spring Cloud Config:配置管理工具,实现应用配置的外部化存储,支持客户端配置信息刷新、加密/解密配置内容等。 Spring Cloud Bus:事件、消息总线,用于传播集群中的状态变化或事件,以及触发后续的处理 Spring Cloud Security:基于spring security的安全工具包,为我们的应用程序添加安全控制 Spring Cloud Consul:封装了Consul操作,Consul是一个服务发现与配置工具(与Eureka作用类似)

How to generate spring cloud feign client using swagger-codegen-maven-plugin

可紊 提交于 2019-12-07 20:23:47
问题 I want to generate my feign client code using swagger-codegen, but I cannot find the docs which can lead me to do it. I have a microservice using spring cloud, several api-services using spring-cloud-feign interfaces to request the data.I wish that i can generate the feign client code. <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>2.2.3</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec

Spring cloud config server - how to add custom PropertySource visible in findOne() method of EnvironmentEncryptorEnvironmentRepository

筅森魡賤 提交于 2019-12-07 19:18:33
问题 My goal is to add custom PropertySource to spring-cloud-server. What I want to achieve is to get some custom properties from that custom source in spring-cloud-config-client application. Basing on suggestions from Adding environment repository in spring-config-server I've created spring-cloud-config-server application and separate project spring-cloud-config-custom . Second one is based on spring-cloud-consul-config code. So, I've created all necessary classes like CustomPropertySource ,

SpringBoot与SpringCloud的版本对应详细版

倾然丶 夕夏残阳落幕 提交于 2019-12-07 15:04:24
缘起 初学spring cloud的朋友可能不知道,其实SpringBoot与SpringCloud需要版本对应,否则可能会造成很多意料之外的错误,比如eureka注册了结果找不到服务类啊,比如某些jar导入不进来啊,等等这些错误。下面列出来springBoot和spring cloud的版本对应关系,需要配套使用,才不会出现各种奇怪的错误。 关于maven仓库的版本列表 spring-cloud-dependencies 版本列表可查看: https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies spring-boot-starter-parent 版本列表可查看: https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent 版本对应关系 大版本对应: Spring Cloud Spring Boot Angel版本 兼容Spring Boot 1.2.x Brixton版本 兼容Spring Boot 1.3.x,也兼容Spring Boot 1.4.x Camden版本 兼容Spring Boot 1.4.x,也兼容Spring Boot 1.5.x

Spring Cloud Contract issues retrieving stubs from Artifactory

橙三吉。 提交于 2019-12-07 12:48:12
问题 I have tests for two consumers and a producer working fine offline but the consumer tests fail when I change them for retrieving the stubs from Artifactory. This is the code for working offline: @RunWith(SpringRunner.class) @SpringBootTest(classes = ContractTestConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.NONE) @AutoConfigureStubRunner(ids = {"com.mycompany:service-name:+:stubs"}, workOffline = true) @ImportAutoConfiguration(org.springframework.cloud.stream.test.binder

Spring Cloud Stream (1)-代码篇

放肆的年华 提交于 2019-12-07 10:54:19
前面博文尝试使用了 Srping CloudBus, 里面引入了 spring-cloud-starter-bus-kafka 和 spring-cloud-starter-bus-amqp ,实时上它们分别依赖了 spring-cloud-starter-stream-kafka 和 spring-cloud-starter-stream –rabbit ,真正实现与这些消息代理进行交互操作的是 Spring Cloud Stream 。一定程度上我们将 Spring Cloud Bus 理解为使用了 Spring Cloud Stream 构建的上层应用。 各种各样的消息队列的产生和更新,使 MQ 组件学习成本越来越高, String Cloud Stream 为一些供应商的消息中间件产品提供了个性化的自动化配置,引入发布订阅、消费组、以及分区这 3 个概念,有效的简化了上层研发人员对 MQ 使用的复杂度,让开发人员更多的精力投入到核心业务的处理。 (有点 OR-Mapping 概念的意思,通过添加一层来消化掉具体实现的差异性与上层客户端松耦合) Spring Cloud Stream 里定义了了 3 种通道: Sink :只有一个输入的通道; public interface Sink { String INPUT = "input"; @Input(Sink.INPUT)

Spring-Cloud系列第6篇:spring-cloud-bus

蹲街弑〆低调 提交于 2019-12-07 10:51:31
自学spring-cloud系列,越来越感觉spring-cloud很强大! 主要分为以下几篇: spring-cloud-config: 分布式配置管理 spring-cloud-eureka: 服务注册与发现 spring-cloud-eureka-consumer: 远程服务调用和及其负载均衡 spring-cloud-Hystrix: 熔断器保证服务高可用 spring-cloud-config-eureka-ribbon: 分布式配置管理的高可用 spring-cloud-bus: 配置信息的实时更新 spring-cloud-zuul: 网关基础服务 介绍 在之前的Spring Cloud Config的介绍中,我们还留了一个悬念:如何实现对配置信息的实时更新。 通过/refresh接口和Git仓库的Web Hook来实现Git仓库中的内容修改触发应用程序的属性更新这是一个好的方法,但是我没讲,因为:若所有触发操作均需要我们手工去维护Web Hook中的应用位置的话,这随着系统的不断扩张,会变的越来越难以维护,而消息代理中间件是解决该问题最为合适的方案。是否还记得我们在介绍消息代理中的特点时有提到过这样一个功能:消息代理中间件可以将消息路由到一个或多个目的地。利用这个功能,我们就能完美的解决该问题,下面我们来说说Spring Cloud Bus中的具体实现方案。

Multiple Spring Cloud Functions in one project for deployment on AWS Lambda

▼魔方 西西 提交于 2019-12-07 08:45:54
问题 I could need some help here... I'm using Spring Cloud Function, and I want to deploy my functions on AWS Lambda, using the adapter for AWS. My application class looks like this: package example; @SpringBootApplication public class SpringCloudFunctionApiGatewayApplication { public static void main(String[] args) { SpringApplication.run(SpringCloudFunctionApiGatewayApplication.class, args); } } Function 1 looks like this: package example; @Component public class StoreFunction implements