0

I understand that I can consume messages from a Solace Durable Queue using either JCSMP or JMS API. I wonder whether I can consume messages from a Solace Durable Queue using MQTT. I tried but I never get it work. My MQTT client tried to subscribe to Durable Queue name but messages in the queue were not delivered to my MQTT Client.

My scenario is the following: Clients from the Internet publish messages to some topics in Solace using MQTT while I have some Durable Queues subscribing to these topics to "attract" messages published to these MQTT topics so that I can process them later. I would like to standardize message exchanges to use only MQTT. Therefore, I would like use MQTT to consume messages stored in this Durable Queues too. Any advice how I can do that.

Thank you.

Koon Sang
  • 319
  • 3
  • 12

1 Answers1

1

The MQTT protocol does not have the concept of queues.

For your use case, your MQTT clients will need to create a durable session, with QoS 1 subscriptions.

This will cause the Solace Appliance/VMR to create an internal durable queue that will spool messages for the client.

Russell Sim
  • 1,693
  • 2
  • 14
  • 22
  • Thanks for the advice. – Koon Sang Jan 08 '16 at 10:31
  • Let me elaborate my use case. I have one Solace appliance in DMZ (let's call this A) for Clients (C1) to publish messages over the Internet with QoS 0 (as there is no ADB in this appliance). I have another Solace appliance with ADB (let's call it B) in my App Zone for my Applications (C2) to process messages from. Can I bridge A and B so that messages published to one appliance is available to clients subscribed from other appliance? Let say, C1 publishes to topic a/b/c on A with QoS 0. C2, subscribes to topics a/b/c on B with QoS 1. Will this work? – Koon Sang Jan 08 '16 at 10:46
  • Yes, this will work. However, do note that the bridge between the DMZ appliance without the ADB and the other appliance will be DIRECT only. This means that messages could be lost through the bridge if it is disconnected for any reason. – Russell Sim Jan 11 '16 at 07:40
  • @RussellSim but this does not really work. A durable queue is indeed created on the Solace Appliance (with the #mqtt/clientId as its name), and it is subscribed to the topic set by the client. But as soon as the client disconnects, the topic subscription is also deleted, even though the durable queue remains. This means no messages will be stored for the client in its absence, which is kind of the whole point of a durable queue. – Beni Murza Jul 05 '18 at 13:00