Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMS transport v/s MQ transport

I am using Oracle Service Bus(OSB) as the MOM, and the destination URI is a IBM MQ queue. I just want to know which would be the preferred transport. OSB provides 2 adapters for the same, JMS adapter and MQ adapter for transport. Does any one knows what are the PROS and CONS of the same. TIA

like image 366
hakish Avatar asked Aug 02 '10 06:08

hakish


People also ask

What is difference between MQ and JMS?

JMS is the specification provided by Sun for messaging. MQ Queue is the IBM's implementation of JMS. Similary JBoss has its own implementation. JMS Queue is the generic term.

What is JMS transport?

The Java Message Service (JMS) transport in WSO2 Enterprise Integrator(WSO2 EI) allows you to easily send and receive messages to queues and topics of any JMS service that implements the JMS specification.

Is JMS a transport protocol?

This section describes the support for the Java™ Message Service transport protocol using SOAP and non-SOAP message formats. For additional information about limitations of the JMS protocol, see Limitations of the JMS Transport protocol.

Does IBM MQ use JMS?

The JMS specification defines a set of interfaces that applications can use to perform messaging operations. From IBM MQ 8.0, the product supports the JMS 2.0 version of the JMS standard.


2 Answers

Typically, sending messages via the native MQI interface will be faster than using JMS. In reality I doubt you will see a real difference, unless you are sending tons of messages per day. However, there are other things to consider than just speed. For example, if you are not familiar with MQI applications the learning curve will be steeper than JMS.

JMS header information is mapped to an MQRFH2 header when sent to another JMS destination via MQ. The inclusion of a MQRFH2 header is driven off of the Destination object you create. If the destination is a JMS endpoint then the header is included.

I have included a link below that explains how the fields are mapped:

  1. Mapping JMS messages onto MQI messages.

In reality, unless you are sending millions of messages a day I would assume that the performance of JMS on WebsphereMQ will be more than adequate for your needs. As far as thread blocking goes in request reply I don't think you need to worry about this. By default the reply in WebsphereMQ is consumed by a seperate thread, not the requesting thread.

like image 148
gregwhitaker Avatar answered Oct 09 '22 04:10

gregwhitaker


Just wanted to add what I found that worked for me. You have to do the following when you create your Queue instance.

Queue queue = queueSession.createQueue("queue:///" + queueName + "?targetClient=1");
//Send w/o MQRFH2 header (i.e. receiver is not a JMS client but just MQ)

The inclusion of the "?targetClient=1" causes the raw message to be sent w/o a header.

Hope this helps someone. Mark

like image 32
Mark Avatar answered Oct 09 '22 06:10

Mark