Shraddha Nalkar
Shraddha Nalkar

Reputation: 53

Difference in RabbitMq and RabbitMq with JMS plugin

I am new to JMS. I am little aware of RabbitMq and now trying to find the difference in rabbitMQ with JMS. How it is used and why it should be used?

Thanks in advance.

Upvotes: 3

Views: 1782

Answers (2)

Zeus
Zeus

Reputation: 6566

I'm not sure what you mean by RabbitMQ for JMS. But, i'll list out the differences below.

RabbitMQ

  1. Works on AMQP protocol and it is not a J2EE specification
  2. Applications written in several languages can produce and consume messages(Python, Ruby, Java, C#, Perl etc.,)
  3. Does not work with J2EE specs, so you cannot use XA Transactions, bean pools, connection factory pools which are all provided by J2EE container by default
  4. Community is not so mature, but, if your organization needs to communicate with a lot of different types and languages of applications you can sacrifice all the beautiful features that are provided by J2EE/JMS spec.

JMS

  1. It is J2EE specification, any application server that provides JMS support should follow the guidelines mentioned in the spec.
  2. Only the Java/J2EE applications can produce and consume, it can be made to work for other languages but with use of adapters
  3. J2EE container provides XA Transaction, Bean pooling, Connection pooling etc., out of the box with little configuration at your end.
  4. If your organization only uses Java based applications, you need not look in RabbitMQ way as you have JMS support which works well.

Upvotes: 0

Gary Russell
Gary Russell

Reputation: 174554

JMS is a Java API (part of JEE).

JMS Vendors use a proprietary protocol to talk to the broker; they are not wire-compatible.

You can generally talk to any JMS broker by just changing vendor-specific configuration (connection factory etc).

Vendors provide a JMS client library to talk to their brokers.

AMQP is a wire protocol, not an API.

Vendors provide a Java client API.

You can use Spring AMQP, which sits on top of RabbitMQ's amqp-client library and its API.

You can use Spring JMS, which talks to any JMS broker (including RabbitMQ with the plugin) using the JMS API.

If you need to be compatible with any JMS vendor, use spring-jms; if you only intend to use RabbitMQ, I would recommend using Spring AMQP.

Or, use Spring Integration on top of either one, and you can switch between AMQP and JMS by just changing configuration.

Upvotes: 2

Related Questions