34

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.

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Shabeeralimsn
  • 797
  • 4
  • 11
  • 32
  • 1
    @ Evan :- no. that article is not talking about Protocol used for JMS. i want to know through which Messages are getting transferred between sender and reciever? – Shabeeralimsn May 27 '14 at 06:05

3 Answers3

47

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.

Isaac
  • 16,458
  • 5
  • 57
  • 81
  • Hello! Very good explanation. So with your last sentence you mean that HTTP for example is not the best choice to be a higher level protocol for JMS? Thanks for advance. – F3R1 Sep 27 '17 at 11:30
  • I'd consider HTTP to be carrying too much overhead for JMS's needs... however, that doesn't mean that using HTTP is not possible. – Isaac Oct 31 '17 at 11:35
13

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.

Aniket Thakur
  • 66,731
  • 38
  • 279
  • 289
-4

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.

Siva
  • 197
  • 1
  • 3