Developing Java Applications with Spring and Spring Boot
by Claudio Eduardo de Oliveira, Greg L. Turnquist, Alex Antonov
How it works...
With a seemingly effortless change, we have switched one service discovery provider, Consul, for another, Eureka. What looked like not much of a change on the outside actually did quite a bit of work under the hood. The reason we were able to do it so easily is the common set of APIs provided by the spring-cloud-commons and spring-cloud-context foundational libraries. Automated module loading support via the spring.factores descriptor allowed for transparent substitution in the initialization of a different service discovery provider. As long as we retained the @EnableDiscoveryClient annotation on our BookPubApplication class, Spring Cloud did the heavy lifting, taking care of loading the appropriate autoconfiguration files ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access