Service Discovery
- Service Discovery Using Eureka
- Spring Cloud - Creating Eureka Server
- Spring Cloud - Creating Eureka Client
- Eureka Client Consumer Example
- Spring Cloud - Eureka Server API
- Spring Cloud - Eureka High Availablity
- Spring Cloud - Eureka Zone Awareness
Synchronous Communication
- Synchronous Communication with Feign Client
- Spring Cloud - Feign Client with Eureka
- Spring Cloud - Testing Feign Client
Synchronous Communication
- Spring Cloud - Gateway
- Spring Cloud - Creating Gateway Application
- Spring Cloud - Testing Gateway Application
- Spring Cloud - Monitoring Gateway Application
Miscellaneous
- Spring Cloud - Load Balancer
- Circuit Breaker using Hystrix
- Streams with Apache Kafka
- Distributed Logging using ELK and Sleuth
Spring Cloud Useful Resources
Spring Cloud - Service Discovery
Introduction
Service discovery is one of the most critical parts when an application is deployed as microservices in the cloud. This is because for any use operation, an application in a microservice architecture may require access to multiple services and the communication amongst them.
Service discovery helps tracking the service address and the ports where the service instances can be contacted to. There are three components at play here −
Service Instances − Responsible to handle incoming request for the service and respond to those requests.
Service Registry − Keeps track of the addresses of the service instances. The service instances are supposed to register their address with the service registry.
Service Client − The client which wants access or wants to place a request and get response from the service instances. The service client contacts the service registry to get the address of the instances.
Apache Zookeeper, Eureka and Consul are a few well-known components which are used for Service Discovery. In this tutorial, we will use Eureka
Dependencies for Eureka Server/Registry
For setting up Eureka Server, we need to update the POM file to contain the following dependency −
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>