/java-mom-clients-libs

Comparsion of Message Oriented Middleware's Java Client libraries

Primary LanguageJava

Comparsion of Message Oriented Middleware's Java Client libraries

Comparsion of Message Oriented Middleware's Java Client libraries

P2P Example - Ping and Pong

  • Ping - Listens to the p2p-ping queue, prints ping and sends a message to p2p-pong.
  • Pong - Listens to the p2p-pong queue, prints pong and sends a message to p2p-ping.

Ping pong

JMS Implementations

Using ActiveMQ Classic

Using RabbitMQ

Spring JMS Implementation

p.s. JMS implementations still required, any of the above.

AMQP 0.9.1 Implementations

Using RabbitMQ

  • 2 Direct exchange with queue

Pub/Sub Example - Horse Race

  • RaceStarter - Publishes to the pubsub-start-race.
  • Appaloosa, Thoroughbred, PaintHorse - Subscribes to pubsub-start-race when created. Prints when receives the message notification.

Horse race

JMS Implementations

Using ActiveMQ Classic

AMQP 0.9.1 Implementations

Using RabbitMQ

  • Topic exchange with matching route
  • fanout exchange

Notes

JMS

  • Java applications should rely on JMS. Using the JMS specification decouples our application code and the message-oriented middleware. Same as JPA does for database.
  • There are two versions of JMS (1.1 and 2.0). 1.1 is synchronous and verbose, while 2.0 is assynchronous and simplified. It's retrocompatible though.
  • JMS is not supported by all the MoMs. Some don't support at all (e.g. GCP Pub/Sub), some only support version 1.1.
  • JMS does not enforces a communication protocol.
  • For Spring Applications, spring provides a wrapper on top of the JMS API.