Which protocol does JMS use to send and receive messages?
Asked Answered
L

3

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.

Lepley answered 27/5, 2014 at 5:59 Comment(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?Lepley
M
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.

Merrythought answered 27/5, 2014 at 6:6 Comment(2)
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.Guiana
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.Merrythought
T
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.

Tildi answered 27/5, 2014 at 16:10 Comment(0)
I
-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.

Insolvency answered 12/12, 2018 at 9:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.