Wednesday, December 17, 2014

MQTT to Message Broker IIB

So now that I have MQTT working on a WebSphere MQ Queue Manager, and once you figure out how to do it it is simple.  The next step is to subscribe to those MQTT topics in order to have queues read from them.

The gist of it is that you create a new local topic first, using the MQ Explorer, When you create that topic, the topic string in the topic has to match the topics that are being published to MQTT.  My MQTT clients in this demo are publishing to the topic /World.  So if I want to set up an MQ Topic that mirrors that, I just say its topic string is /World. No need for a subscription between MQTT and the MQ Topic.  MQ just magically maps between the two.

Then you create a subscription to that WebSphere MQ topic from a local queue, and then MQ has access to that queue.

The Message Broker App I've written reads the queue and write to a file.  It looks like this, just a queue input node and a file writer output node, tied together.  I set the message parser to JSON just in case I start to process messages in some later part of this.






1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete