This is a question that annoys me for a while, how to write a number of microservices that work on different machines in different places without the need for hard coding of each service in a separate location?
Like for example, I had a service A that does some form of json message validation. Service A runs on box 1,3,5, and more cases can be raised as demand grows.
Now tell me that I have service B that wants to call service A, how can I contact service B, where is my service A?
Possible solutions that I reviewed:
Hard coding service B with a "master" node location for service A, which then delegates tasks for all instances of service A.
Using message queues? - Service B writes to the message queue queue, Service A instances read from the specified message queues, and sends the results to service B.
SSDP is the use of some form of a simple service discovery protocol to broadcast those services that are on the network and track these services.
I am new to this architectural style, so I hope I haven’t missed something very simple.
source
share