Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why bother with service discovery when message oriented middleware does the job?

Tags:

I get the problem that etcd/consul/$whatever are trying to solve. Service consumers need to talk to service providers, a hugely fluid distributed system needs a mechanism to marry the two.

However, the problem of "where do service consumers go with their requests?" is old and IMO has been solved with MOM -- message oriented middleware.

In MOM, the idea is that service consumers do not care where the service providers live. They simply send a message and have the messaging bus take care of routing the message to the appropriate consumer. There can be multiple providers all doing the same thing (queue-based round-robin) or versioned providers (/v1/request goes to one, /v2/request goes to another).

This is a simple, powerful integration pattern that completely decouples a service interface from its implementation.

And yet I see this bizarre obsession with discovering service providers, which appears to create tight coupling between consumers and providers (in addition to a few other anti-patterns as well.)

So, what am I missing here? TIA.

like image 884
Susan Barr Avatar asked Feb 15 '15 04:02

Susan Barr


People also ask

What is the importance of message oriented middleware?

Roles of message-oriented middleware MOM helps in implementing the delivery of messages across different IT organizations. It will create a distributed product that is compatible with the various OS. MOM allows various software components can talk to each other.

Why do we need a message broker?

A Message Broker is a software that allows services and applications to communicate with one another through the use of messages. The structure of the messages is formally defined and independent of the services that send to them.

What is the difference between message queue and message broker?

Message queues provide a means for applications to push information to the queue. The message broker simply takes the information from the sender, translates it between different messaging protocols, if needed, and delivers the message to the correct receiver.

What is a message broker service?

A message broker (also known as an integration broker or interface engine) is an intermediary computer program module that translates a message from the formal messaging protocol of the sender to the formal messaging protocol of the receiver.


1 Answers

In MOM, everything flows through the bus, so it might become a bottleneck. With service discovery, a consumer looks up a producer "once" (ok it might have to check back again after a while), and then "directly" (ok could be through a proxy) talks to it.

Or if you prefer catchy phrases: smart endpoints & dumb pipes vs (i guess) dumb endpoints & smart pipes.

like image 119
milan Avatar answered Sep 19 '22 00:09

milan