Skip to content
This repository was archived by the owner on Sep 19, 2020. It is now read-only.

Latest commit

 

History

History
 
 

service

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Service Discovery Example

This is a fairly real-world usage of Discovery.

In this example we setup three interconnected services, which will communicate via RabbitMQ, and run the initial service discovery through Discovery. The master, in this case, is a service dedicated to the well-being of the message queue, and it along holds the keys to the queue, which the service distributes via Discovery.

Services

Each service uses the service discovery component of node-discovery, exposed as the ServiceDiscovery property of the module.

The master service pretends to manage the databases and message queues, and advertises their presence and configuration information.

The registration service handles registration requests, and could notify the user of their registration success via an email service through the message queue. After the registration succeeds, the register service pushes a notice back to the web service for the registration stream.

The web service handles incoming http requests, and either handles the responses or delegates their actions through the message queue.