2
votes

I'm trying to send messages between an application using WebSphere MQ queues, and a nodeJS application using the Websphere MQ topics via the MQTT protocol.

I know we can create an alias queue :

  • pointing to a topic (in that case, the application listen to new publications via an alias queue),
  • pointing to another queue.

Now, I want the opposite procedure:

How can I create an alias topic pointing to a queue ? In that case, the nodeJS applicaton would be able to listen to the incoming messages via the alias topic from the other application which pushes messages on the original queue.

Configuration :

  • WebSphere v7.5
  • Node v5.5.0
  • Protocol MQTT v3
1
Can you please update your question with more details on scenario? How an alias topic pointing to a queue helps your case?Shashi

1 Answers

1
votes

Finally, I found myself the answer.

To resolve it, I had to create a subscription, specifying the topic source and the queue destination. To do it, in the IBM WebSphere MQ Explorer :

  • Go in the navigator -> IBM WebSphereMQ -> Queue Managers -> Select your queue -> Subscriptions -> New -> Subscription
  • Enter the name of your subscription -> click "Next"
  • Enter/Select the default attribute "SYSTEM.DEFAULT.SUB"
  • Enter the name of the topic (you can select it among the existing in the button on the right)
  • Enter the name of the existing queue destination
  • Click "Terminate"

That's it ! There were the minimal prerequisites to make it, but you can specify other options. You can check the properties of subscription on the documentation via this link : https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.explorer.doc/e_properties_subs.htm

Note : The instructions' words can be slightly different because I translated the functionnalities of the Websphere MQ software from french to english to answer this post.

(Edit) Explanation :

My NodeJS application has to communicate both ways (publish/receive) with the other app. As @Shashi said in the comments, MQTT protocol basically works only with Publish/Subscribe model. However, it is able to communicates with a queue thanks to the "Subscription" functionnality of IBM WebSphere MQ software as I explain earlier.

Indeed, according to what I understand, the "Subscription" functionnality is a kind of "bridge" linking/converting a topic (for the NodeJS) to a destination queue (for the app).

It is the opposite of what an AliasQueue can be for a Topic in IBM Websphere MQ :

"An alias name can also resolve to a topic. If an application currently puts messages onto a queue, it can be made to publish to a topic by making the queue name an alias for the topic. No change to the application code is necessary." (from the documentation)