spring-cloud

Securing Eureka in Spring cloud

好久不见. 提交于 2019-12-04 09:54:39
I am curious about what options I have for securing a service connecting (registering and getting disco info) to eureka. Obviously I want to turn security on in Eureka and specify a username password for service. One question that I have is how do services trying to connect to eureka specify their credentials? Is it through the specification of the zone and what is the format of this reference? *** I actually the answer to the above question and posted below, But still wonder about the following As well, can I specify more strenuous security mechanisms and if so, which and how? Ok, turns out

How to fine-tune the Spring Cloud Feign client?

雨燕双飞 提交于 2019-12-04 09:07:51
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. From what I see in the code and based on Dave Syer's answer here , Feign does't use a RestTemplate . So

Spring Cloud Config Server Priority of Environment Variables

淺唱寂寞╮ 提交于 2019-12-04 08:52:00
问题 I have a question regarding the priority of environment variables when working with spring cloud config server In my service I have a local properties file application.yml with this content foo: bar: "some" buz: "some" joe: "some" The service is also connected to a config server with a configuration repository that contains a file testservice-api.yml (where testservice-api is the spring application name of the service). The contents of this file is: foo: bar: "some-specific" So with this

org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:2.1.3.RELEASE导入失败

ε祈祈猫儿з 提交于 2019-12-04 08:13:49
导入eureka-server的jar包失败,有两种方法解决: 方法一:如果Event log 输出下面信息,可按照图片进行设置 方法二:将springcloud版本换掉(这是在创建项目时切换版本) 项目创建成功后改变版本号: 来源: https://www.cnblogs.com/zff2099/p/11847891.html

Unable to get /hystrix.stream in Spring Cloud

扶醉桌前 提交于 2019-12-04 07:54:43
I have created a microservice with following dependencies of Spring cloud version Camden.SR2 . Spring Boot 1.4.1. http://localhost:8080/hystrix.stream is not responding. If I make the Spring Cloud version as Brixton.* (RELEASE, SR1,...), I get only ping: as reply in browser. <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId>

Managing logging.level using ConfigServer

家住魔仙堡 提交于 2019-12-04 06:24:01
问题 Spring Boot application using 1.1.9.RELEASE Trying to setup logging in the simplest case logging: level: org.springframework.web: DEBUG Scenario 1: adding above lines to application.yml in /resources - WORKS Scenario 2: when adding these lines to github repo used by config server however application does not seems to use it. Just to make sure calling /env endpoint produces the following output configService:https://github.com/myrepo/config/file:/mypath/transportation.yml: { logging.level.org

Java Spring Boot: Reload config without spring cloud config server

て烟熏妆下的殇ゞ 提交于 2019-12-04 04:53:46
问题 I am trying to reload configuration of my application during runtime. The configuration is in a yaml file and the binding with @ConfigurationProperties works as expected. Next thing is. I want to reload the config when the yaml has changed. Or rather I am checking with @Scheduled whether the file has changed. I would like to avoid running a second server for having my Environment update. The two questions I have: How do I update the environment, ConfigurableEnvironment maybe? How do I

com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect

北城余情 提交于 2019-12-04 03:38:50
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) ~[jersey-apache-client4-1.19.1.jar:1.19.1] at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123) ~[jersey-client-1.19.1.jar:1.19.1] at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27) ~[eureka-client-1.9.3.jar:1.9.3] at com.sun.jersey.api.client.Client.handle(Client.java:652) ~[jersey-client-1.19.1

Ribbon with Spring Cloud and Eureka: java.lang.IllegalStateException: No instances available for Samarths-MacBook-Pro.local

馋奶兔 提交于 2019-12-04 01:18:29
I am working on Spring Boot Eureka Client Application with Ribbon Load Balancer. I have two instances of the server registered with Eureka with the name "TEST". On the client side, I have the following code to fetch the server from Eureka. @Configuration @ComponentScan @EnableAutoConfiguration @EnableEurekaClient @RestController public class EurekaConsumerApplication { @Autowired DiscoveryClient discoveryClient; @Autowired RestTemplate restTemplate; @RequestMapping(value = "/",method = RequestMethod.GET) String consumer(){ InstanceInfo instance = discoveryClient.getNextServerFromEureka("TEST",

File upload spring cloud feign client

感情迁移 提交于 2019-12-03 21:48:28
When make a post request from one microservice to another using feign client of spring cloud netflix, I get the following error in Postman : { "timestamp": 1506933777413, "status": 500, "error": "Internal Server Error", "exception": "feign.codec.EncodeException", "message": "Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class java.io