Microservice Registration With Spring Cloud Using Netflix Eureka - Part 1

A service registry is a phone book for your microservices. Each service registers itself with the service registry and tells the registry where it lives (host, port, node name).

When we start a project, we add all the configuration in the properties file. As more and more services are developed and deployed, adding and managing these properties become more complex. Some services might go down, while for some the location might change. This manual changing of properties may create issues.

Service Registration and Discovery helps in such scenarios. There are several popular options for service registeries.

  1. Airbnb’s SmartStack

  2. Netflix’s Eureka

  3. Bitly’s NSQ lookupd

  4. Serf

I’ll focus on Eureka in this post because it is implemented on the JVM and can be bootstrapped automatically in one of Spring Cloud’s auto-configurations. As all services are registered to the Eureka server and lookup done by calling the Eureka server, any change in service locations need not be handled and is taken care of.

This article is first among a series of 5 articles:

THIS - Overview of Netflix components.

Part 2 - Develop an Student service to produce and consume REST API using Spring Boot

Part 3 - Use Eureka for Service Registration

Part 4 - Use Eureka for Service Discovery

Part 5 - Load balancing using Netflix Eureka + Ribbon

Overview of Netflix components

Netflix OSS is a set of frameworks and libraries that Netflix wrote to solve some interesting distributed-systems problems at scale. The patterns include Service Discovery (Eureka), Circuit Breaker (Hystrix), Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon).

Netflix Component Name Functionality
Eureka Service Registration and Discovery
Ribbon Dynamic Routing and Load Balancer
Hystrix Circuit Breaker
Zuul Edge Server

In the next part of this tutorial, we will develop two spring boot projects: student producer and student consumer and further we will register these services with Eureka and apply load balancing using Ribbon.

Read More