spring-cloud

Working With Eureka Clients Programmatically issue - Completed shut down of DiscoveryClient

六眼飞鱼酱① 提交于 2019-12-10 11:35:28
问题 I've createde Eureka server with the replication and now trying to start the client. When I'm trying to start the spring-microservices-eureka-client , I get the below error. Using Spring Boot Version 2.1.1.RELEASE . The same error is coming with the Boot Version 2.0.7.RELEASE and Finchley.SR2 . 2018-12-28 13:52:16.741 INFO 20236 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application UNKNOWN with eureka with status UP 2018-12-28 13:52:16.742 INFO 20236 --- [ main] com.netflix

loading multiple properties with config-server

旧时模样 提交于 2019-12-10 10:14:24
问题 I have successfully tested loading properties from SVN repository, currently in my config server i have provided the URI and default-label: trunk and i have application specific property under trunk . below is the contents of my consuming application's application.yml and able to pull the properties successfully spring: application: name: foo-development cloud: config: uri: http://localhost:${config.port:8888} now i have a shared property in different folder thats shared across other

How to disable eureka lookup on specific @FeignClient

倾然丶 夕夏残阳落幕 提交于 2019-12-10 09:32:47
问题 I have a microservice that uses @FeignClient predominantly to talk to other micro-services. This works beautifuly using Eureka's service discovery mechanism. Now I have a pressing need to use a @FeignClient to connect to an external system and still perform load balancing using configurations as shown below. Feign client : @FeignClient("externalServers") public interface ExternalServersClient { @RequestMapping(method = RequestMethod.GET, value = "/someExternalUrl") ResponseEntity<Object>

AWS CodeCommit HTTPS access without setting up credential helper

主宰稳场 提交于 2019-12-10 06:15:23
问题 We are transitioning from GitHub to AWS CodeCommit to have a tightly integrated environment. One need is to access one repository through HTTPS. This repo is accessed ny Spring Cloud Config Server product that uses jgit to read the repo and clone the files for its use. AWS CodeCommit apparently requires the use of the credential helper when connecting through HTTPS, but I don't the setup to be like that. I want a user and password setup that jgit can use without the need to generate a temp

Spring Cloud Sleuth + log4j2

左心房为你撑大大i 提交于 2019-12-10 03:52:21
问题 Some of my microservices use log4j2 as logger. Spring cloud Sleuth has support for logback. How can I use Sleuth to get distributed tracing in this scenario. I understand to use sleuth with log4j2, I have to implement certain class. I tried this but no luck. Please help 回答1: Please try with the latest 2.0.0.M6 release where we use Brave internally. You can check out the https://github.com/openzipkin/brave/tree/master/context/log4j12 module how to set up the logging mechanism properly. In

Spring-cloud Zuul retry when instance is down

别来无恙 提交于 2019-12-09 22:38:05
问题 Using Spring-cloud Angel.SR6: Here is the configuration of my Spring-boot app with @EnableZuulProxy: server.port=8765 ribbon.ConnectTimeout=500 ribbon.ReadTimeout=5000 ribbon.MaxAutoRetries=1 ribbon.MaxAutoRetriesNextServer=1 ribbon.OkToRetryOnAllOperations=true zuul.routes.service-id.retryable=true I have 2 instances of service-id running on random ports. These instances, as well as the Zuul instance, successfully register with Eureka, and I can access RESTful endpoints on the 2 service-id

pom父工程dependencyManagement中的jar包在子工程中不写版本号无法引入的问题

空扰寡人 提交于 2019-12-09 19:35:40
1.遇到的问题: 本人用的idea,然后在导入别人的项目的时候,pom文件中没有报错了,但是在maven栏目中jar包却一直报红,是因为我没写版本的原因吗?不对呀,我的父工程下已经写了springboot的版本了呀, 难道父工程本身就没有引入进来吗? 像这种的jar包好多报红的,@SpringBootApplication都无法引入,更别说其他的注解了,都是一个样。 2.解决的办法: 原因是由于spring-cloud-dependencies包的版本问题,应当将版本由Finchley.SR1更改为Finchley.RELEASE,之后更新一下包问题就解决了。 <dependencies> <!-- springCloud --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Finchley.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> <dependencies> 将version版本改一下就好了, Finchley.RELEASE是正式版的。 还是自己不细心吧,不过最好还是用正式的,用着放心

How to fine-tune the Spring Cloud Feign client?

回眸只為那壹抹淺笑 提交于 2019-12-09 13:19:12
问题 The Spring Cloud doc says: If Hystrix is on the classpath, by default Feign will wrap all methods with a circuit breaker. That's good but how do I configure the Hystrix options to ignore certain exceptions? I've an ErrorDecoder implementation that maps HTTP status code to exceptions. If I put @HystrixCommand on the method, does Feign honor that? Our requirement is to log various details about every HTTP call made out to dependencies. Currently I've a decorated RestTemplate that does this.

Unreachable security context using Feign RequestInterceptor

空扰寡人 提交于 2019-12-09 12:50:13
问题 The goal is to attach some data from security context using RequestInterceptor, but the problem, that the calling SecurityContextHolder.getContext().getAuthentication() always returns null even though it is not null (I am sure 100%). As I understand that's because the Interceptor is created and is being run in other thread. How could I solve this problem and get actual data from security context? My service: @FeignClient(value = "api", configuration = { FeignConfig.class }) public interface

What's the difference between zookeeper vs spring cloud config server?

柔情痞子 提交于 2019-12-09 08:58:58
问题 What's the difference between zookeeper vs spring cloud config server? They both store configurations in server and make them available to clients. When should one be used over the other? 回答1: What's the difference between zookeeper vs spring cloud config server? With the Spring Cloud Config Server you have a central place to manage external properties for applications across all environments. The concepts on config server map identically to the Spring Environment and PropertySource