Message Queue vs Message Bus -- what are the differences?

Anton Gogolev picture Anton Gogolev · Oct 17, 2011 · Viewed 63.9k times · Source

And are there any? To me, MB knows both subscribers and publishers and acts as a mediator, notifying subscribers on new messages (effectively a "push" model). MQ, on the other hand, is more of a "pull" model, where consumers pull messages off a queue.

Am I completely off track here?

Answer

vijay picture vijay · Nov 28, 2015

Message Bus

A Message Bus is a messaging infrastructure to allow different systems to communicate through a shared set of interfaces(message bus).

enter image description here

Source: EIP

Message Queue

The basic idea of a message queue is a simple one:

  • Two (or more) processes can exchange information via access to a common system message queue.

  • The sending process places via some (OS) message-passing module a message onto a queue which can be read by another process

Source: Dave Marshall

enter image description here

Image source

Difference

Message Queue contains FIFO(first in first out) rule whereas in Message Bus does not.

Conclusion

Both LOOK like doing same kind of work - passing messages between two Applications or Modules or Interfaces or Systems or Processes, except small difference of FIFO