Microservice: Service Discovery and Registration Service with Akka

I am going to apply the Microservices architecture to my application. Interconnection between microservices will be achieved with Akka. But I do not know how all microservices know and register each other. I have several options for developing a registry of services and discovery:

1) Use Zookeeper as a centralized service for storing all metadata of all microservices (nodes) and let them access this metadata for communication. The metadata of each node contains Akka path information (address) to inform other nodes.

2) Connect all the microservices (Akka nodes) to the Akka cluster, and each node will link to each other. Akka Cluster supports the gossip protocol, and it will let all the nodes in the cluster know together.

Can someone give me some advice on this? How to effectively create Service Discovery and Service Registry on top of Akka? Are there any options for this?

+4
source share
1 answer

I created similar distributed applications using the second approach you proposed, in which microservices are launched in an Akka cluster with several predefined seeder nodes. Each microservice identifies itself using Roles and has a list of roles that interest it.

Each node / microservice has an actor that listens for Member Events, which is responsible for maintaining the path address for the nodes of interest, and also acts as a router for node messages.

, .

+1

Source: https://habr.com/ru/post/1670919/


All Articles