Eureka Server: How to achieve high availability

Eureka Discovery Server should be used in the Peer-Aware config mode in production setups. Check: http://cloud.spring.io/spring-cloud-static/spring-cloud.html#_peer_awareness For instance your first eureka server instance will have config like this: server: port: 1111 eureka: instance: hostname: peer1 client: serviceUrl: defaultZone: http://peer2:1112/eureka/ ..and second server instance like this: server: port: 1112 eureka: instance: hostname: peer2 client: serviceUrl: defaultZone: … Read more

How can I change the feign URL during the runtime?

You can add an unannotated URI parameter (that can potentially be determined at runtime) and that will be the base path that will be used for the request. E.g.: @FeignClient(name = “dummy-name”, url = “https://this-is-a-placeholder.com”) public interface MyClient { @PostMapping(path = “/create”) UserDto createUser(URI baseUrl, @RequestBody UserDto userDto); } And then the usage will be: … Read more

What’s the difference between EnableEurekaClient and EnableDiscoveryClient?

There are multiple implementations of “Discovery Service” (eureka, consul, zookeeper). @EnableDiscoveryClient lives in spring-cloud-commons and picks the implementation on the classpath. @EnableEurekaClient lives in spring-cloud-netflix and only works for eureka. If eureka is on your classpath, they are effectively the same.

tech