Introduction

In this guide, we’ll be utilizing Netflix Eureka, a microservice discovery service to combine a Spring Boot microservice with a Flask microservice, bridging services written in totally different programming languages and frameworks.

We’ll be building two services - The End-User Service, which is a Spring Boot service oriented at the end-user, that collects data and sends it to the Data-Aggregation Service - a Python service, using Pandas to perform data aggregation, and return a JSON response to the End-User Service.

Netflix Eureka Serice Discovery

When switching from a monolith codebase to a microservice-oriented architecture - Netflix built a plethora of tools that helped them overhaul their entire architecture. One of the in-house solutions, which was subsequently released to the public is Eureka.

Netflix Eureka a service discovery tool (also known as a lookup server or service registry), that allows us to register multiple microservices, and handles request routing between them.

It’s a central hub where each service is registered, and each of them communicates with the rest through the hub. Instead of sending REST calls via hostnames and ports - we delegate this to Eureka, and simply call the name of the service, as registered in the hub.

To achieve this, a typical architecture consists of a few elements:

eureka microservice architecture

You can spin off the Eureka Server in any language that has a Eureka wrapper, though, it’s most naturally done in Java, through Spring Boot, since this is the original implementation of the tool, with official support.

Each Eureka Server can register N Eureka Clients, each of which is typically an individual project. These can also be done in any language or framework, so each microservice uses what’s most suitable for their task.

We’ll have two clients:

  • End-User Service (Java-based Eureka Client)
  • Data-Aggregation Service (Python-based Eureka Client)

Since Eureka is a Java-based project, originally meant for Spring Boot solutions - it doesn’t have an official implementation for Python. However, we can use a community-driven Python wrapper for it:

  • Netflix Eureka
  • Python’s Eureka Client

With that in mind, let’s create a Eureka Server first.

#java #spring boot #python #microservices #eureka

Spring Boot and Flask Microservice Discovery with Netflix Eureka
3.75 GEEK