JMS and AMQP - RabbitMQ JMS and AMQP - RabbitMQ java java

JMS and AMQP - RabbitMQ


Your question is a bit messy but Let's see its bits one by one.

General concept:

The Java Message Service (JMS) API is a Java Message Oriented Middleware (MOM) API for sending messages between two or more clients. JMS is a part of the Java Platform, Enterprise Edition, and is defined by a specification developed under the Java Community Process as JSR 914. It is a messaging standard that allows application components based on the Java Enterprise Edition (Java EE) to create, send, receive, and read messages. It allows the communication between different components of a distributed application to be loosely coupled, reliable, and asynchronous.

Now (from Wikipedia):

The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for message-oriented middleware. Thedefining features of AMQP are message orientation, queuing, routing(including point-to-point and publish-and-subscribe), reliability andsecurity.

And the most important thing (again from Wikipedia):

Unlike JMS, which merely defines an API, AMQP is a wire-levelprotocol. A wire-level protocol is a description of the format of thedata that is sent across the network as a stream of octets.Consequently any tool that can create and interpret messages thatconform to this data format can interoperate with any other complianttool irrespective of implementation language

Some important things you should know:

  1. Keep in mind that AMQP is a messaging technology that do not implement the JMS API.
  2. JMS is API and AMQP is a protocol.So it doesn't make sense to say that what is default protocol of JMS, of course clientapplications use HTTP/S as the connection protocol when invoking aWebLogic Web Service.
  3. JMS is only a API spec. It doesn't use any protocol. A JMS provider (like ActiveMQ) could be using any underlying protocol torealize the JMS API. For ex: Apache ActiveMQ can use any of thefollowing protocols: AMQP, MQTT, OpenWire, REST(HTTP), RSS and Atom,Stomp, WSIF, WS Notification, XMPP. I suggest you read UsingJMS Transport as the Connection Protocol.

Good Luck :)


Let's start from the basis.

RabbitMQ is a MOM (Message Oriented Middleware), developed with Erlang (a TLC-oriented programming language) and implementing the wire protocol AMQP (Advance Message Queuing Protocol). Currently, many Client APIs (e.g., Java, C++, RESTful, etc.) are available to enable the usage of RabbitMQ messaging services.

JMS (Java Messaging Service) is a JCP standard defining a set of structured APIs to be implemented by a MOM. An example of MOM that implements (i.e. is compatible with) the JMS APIs is ActiveMQ; there's also HornetMQ, and others. Such middlewares get the JMS APIs and implement the exchange patterns accordingly.

According to above, taken the skeleton of JMS APIs, an instance of RabbitMQ and its Java Client APIs, it is possible to develop a JMS implementation making use of RabbitMQ: the only thing that one has to do, at that point, is implementing the exchange pattern (over RabbitMQ) according to the JMS specification.

The key is: a set of APIs, like JMS, can be implemented no matter of the technology (in this case, RabbitMQ).


JMS, when it was defined did not define a protocol between the JMS client and a messaging server. The JMS client, which implement the JMS API can use whatever protocol to communicate with messaging server. The client just need to be compliant with JMS api. Thats all. Ususally JMS clients use a custom protocol that their messaging server understands.

AMQP on other hand is a protocol between a messaging client and messaging server. A JMS client can use AMQP as the protocol to communicate with the messaging server. And there are clients like that available.

http://www.lshift.net/blog/2009/03/16/openamqs-jms-client-with-rabbitmq-server