spring-cloud

Spring Cloud Config + ejb

心不动则不痛 提交于 2020-01-06 14:08:55
问题 I am setting for my application set the 'Spring Cloud Config' (http://cloud.spring.io/spring-cloud-config/) to make all the centralized settings, however there is a problem, I have a set of 10 applications, however an application is using legacy EJB, there are some connector or customer 'Spring Cloud Client Setup' for EJB? 回答1: Non-Spring java apps and non-java apps can use the spring cloud config server rest api. See this answer. You would probably be interested in these endpoints that

HikariCP restart with Spring Cloud Config

孤街浪徒 提交于 2020-01-06 06:17:04
问题 I have recently configured my application to use Spring Cloud Config with Github as a configuration repository. Spring Boot - 2.1.1.RELEASE Spring Cloud Dependencies - Greenwich.RC2 My application is using pretty much everything out of the box. I have just configured the database in application.yml and I have HikariCP autoconfigurations doing the magic in the background. I am refreshing my applications using this job that calls refresh() method on the RefreshEndpoint. import org.slf4j.Logger;

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 :

Spring Cloud Zuul proxy Gateway does not load css, js from Spring Boot Application

被刻印的时光 ゝ 提交于 2020-01-06 03:41:28
问题 I have created a gateway application using Spring Cloud Zuul proxy. The gateway application working fine but it is not loading static files like img,css and js files. I have added below setting in my application.properties file of my gateway application zuul.routes.demo.url=http://localhost:8091 where demo is the value of spring.application.name property of my spring boot application. If i run my spring boot application, then all css or js or static files like img loads perfectly fine. But

跟我学SpringCloud | 第七篇:Spring Cloud Config 配置中心高可用和refresh

谁说胖子不能爱 提交于 2020-01-05 11:47:12
SpringCloud系列教程 | 第七篇:Spring Cloud Config 配置中心高可用和refresh Springboot: 2.1.6.RELEASE SpringCloud: Greenwich.SR1 如无特殊说明,本系列教程全采用以上版本 1. 引言 上一篇我们聊了Spring Cloud Config 配置中心,并且和Github做了集成,我们的Server端是单机版的,任何单机版的服务都只能使用与测试环境或者自己做Demo测试, 生产环境严禁使用单机服务 ,配置中心在整个微服务体系中都是及其重要的一个节点,尤其是在DevOps中自动扩容,如果配置中心宕机,那么所有的自动扩容都会失败。 所以这一篇我们聊聊配置中心的高可用,说到高可用,在springcloud体系中,是有注册中心的,那么,我们的配置中心也是一个服务,可不可以使用Eureka做服务的注册与发现呢? 答案是肯定的。 2. Serve端 我们将上一篇的Serve端Copy到新的目录中,增加Eureka-client的依赖,使得Config-Serve可以注册到Eureka上。 2.1 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=

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 cloud stream Special Chars in Message received from kinesis

杀马特。学长 韩版系。学妹 提交于 2020-01-04 09:25:00
问题 When I consume the message from kinesis stream. I get some junk chars with headers etc @StreamListener(Processor.INPUT) public void receive(String message) { System.out.println("Message recieved: "+message); throw new RuntimeException("Exception thrown"); } @StreamListener("errorChannel") public void transform(ErrorMessage errorMessage) throws UnsupportedEncodingException { //original paylaod System.out.println("Error Oiginal Message Payload"+new String((byte[])errorMessage.getOriginalMessage

What is Release Train Bom?

≡放荡痞女 提交于 2020-01-03 18:31:11
问题 I am working on Spring cloud contract documentation and I have seen a comment in dependency from Spring cloud documentation and would like to know what exactly is this <!-- If you're adding this dependency explicitly you have to add it *BEFORE* the Release Train BOM--> 回答1: Please read the docs: https://projects.spring.io/spring-cloud/ . If you go to Quick Start you'll see The release train label (see below) is actually only used explicitly in one artifact: "spring-cloud-dependencies" (all

@RefreshScope with @ConditionalOnProperty does not work

房东的猫 提交于 2020-01-03 09:09:16
问题 Problem Exploring an option of enabling/disabling a @RequestMapping endpoint on demand without restarting JVM. Implement a kill switch on a endpoint at runtime. Attempt I've tried the following but @RefreshScope does not seem to work with @ConditionOnProperty @RestController @RefreshScope @ConditionalOnProperty(name = "stackoverflow.endpoints", havingValue = "enabled") public class MyController { @Value("${stackoverflow.endpoints}") String value; @RequestMapping(path = "/sample", method =

Spring Cloud - SQS

为君一笑 提交于 2020-01-03 08:41:36
问题 I'm trying to get a simple queue handler working with the Spring Cloud framework. I've successfully got the message handler polling the queue, However. The problem I'm seeing is that when I post a message to the queue, my handler is failing to unmarshall the payload in to the required java Object. @MessageMapping("MyMessageQueue") @SuppressWarnings("UnusedDeclaration") public void handleCreateListingMessage(@Headers Map<String, String> headers, MyMessage message) { //do something with the