Shabeeralimsn
Shabeeralimsn

Reputation: 825

Which protocol does JMS use to send and receive messages?

I want to know if JMS API uses any protocol to transfer messages or if uses its own. If the former, which protocol?

I have read many articles over the net but I couldn't find an answer for this.

Upvotes: 35

Views: 33465

Answers (3)

Siva
Siva

Reputation: 305

It uses AMQP protocol. You can use JMS to do 1-to-1 communication using Message Queue provided by Middleware. If you want to send 1-to-many using JMS, the middleware provides Topic. Both of them use binary format in a bit stream at least in IBM MQ.

Upvotes: -5

Aniket Thakur
Aniket Thakur

Reputation: 68935

There is no protocol as such that is mentioned in the JMS specs. It is purely dependent on the JMS provider and his approach to offer efficiency and security.One thing that er can be sure of is that whatever protocol provider uses to communicate between server and client will be built upon the TCP/IP protocol(Transport layer). You may have HTTP which is an application layer protocol or if the provider provides it you may have SSL which is a Presentation layer protocol.

For example ActiveMQ supports following protocols

  • AMQP
  • List item
  • MQTT
  • OpenWire
  • REST
  • RSS and Atom
  • Stomp
  • WSIF
  • WS Notification
  • XMPP

More details here.

Upvotes: 14

Isaac
Isaac

Reputation: 16736

The standard JMS API is merely a set of interfaces; JMS providers (such as WebSphere MQ) provide their own implementations for these interfaces.

The only thing that you can say for sure about all JMS implementations is that they all adhere to the JMS API; other than that, a JMS implementation may use any protocol whatsoever in order to fulfill the JMS API contracts.

Now, when you're asking specifically about "protocols", you should also define which "layer" in the communication you are referring to (have a look at the OSI Model, for example). When your JMS client has to talk to a JMS server that is located on another machine on the network (a typical case), the protocol used between the client and the server will be based, in one way or another, on TCP/IP. Over the wire, you'll be able to see TCP/IP packets being exchanged back and forth.

At the higher level, there are no guarantees; you are likely to find proprietary protocols varying between different implementors. Remember that, with JMS, performance is often crucial; JMS vendors put a lot of efforts into ensuring that their protocols ("above" TCP/IP) perform well. HTTP, for example, won't do.

Upvotes: 47

Related Questions