Search code examples
javaibm-mq

Replacing IBM MQLight 1.0 with IBM MQ 9.3.3


I have a java program that currently sends and receives data from an old IBM MQ Light queue. I had a couple questions about setting up the newer libraries in place of the old MQlight ones.

My first was about the protocol. If I had a Java object previously that was just a couple strings, an int, and that was getting passed along using the MQLight protocol, how can I set it up the same way using IBM MQ? Do I need to create a JMS factory, or can it work by just creating a queue manager and casting the object to TextMessage or MQMessage and then pass that along to the topic via the queue?

Second, do I need to pretty much keep the send queue's open all the time if I'm receiving and sending a lot of data? Or is it best practice to close them after each publish/subscribe at frequent intervals?

Thanks everyone


Solution

    1. IBM MQ Light used the AMQP wire protocol. IBM v9.3 supports AMQP wire protocol. Therefore, you should be able to swing your application from using MQ Light to IBM MQ with minimal changes, if any.

    2. Do NOT pass Java objects around because it limits what types of applications can consume your messages. Put the information in either XML or JSON format and send that as an MQ message.

    3. Definitely keep the queue or topic open while consuming and/or publishing messages.