O'Reilly logo

Microservices Deployment Cookbook by Vikram Murugesan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing service discovery using Spring Cloud Consul

In the previous recipe, we orchestrated a consul agent in development. In this recipe, we will be using that consul agent to implement service discovery for the geolocation microservice. When we did something similar using Zookeeper, there was lot of code involved to connect to Zookeeper, identify the IP, identify the port, and finally register the service. We performed these steps using the curator API, which made our life easier. But fortunately, you don't have to do all this for consul. Spring Cloud has a library for consul, which automatically registers the service with the host and port information. All we have to provide is a couple of properties. Let's take a look at how to do that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required