Sticky MQTT Sessions and queueing (clean session = false) not working

449 views
Skip to first unread message

Ralf Rottmann

unread,
Oct 7, 2016, 8:09:37 AM10/7/16
to rabbitmq-users
We're evaluating RabbitMQ for an MQTT solution but would need queueing / sticky sessions. However, we cannot seem to get them to work.

Here is what we did so far:
  • Installed RabbitMQ and used the default config.
  • Did not manually add any exchanges, bindings or queues.
  • Used the Mosquitto command line client to subscribe, with clean sessions = false. CLI: 
    mosquitto_sub -A localhost -p 1883 -c -t /broker/tb-987BF31183EB -i mosquitto_sub
  • Used the Mosquitto command line client to publish. CLI:
    mosquitto_pub -A localhost -p 1883 -i mosquitto_pub -t /broker/tb-987BF31183EB -q 1 -m Tick
On connection of the subscription client, we can see two queue being created via Management GUI:
  • mqtt-subscription-mosquitto_subqos0
  • mqtt-subscription-mosquitto_subqos1
When publishing while the subscribed client is connected, everything works fine.
However, when the client disconnects, the queues vanish. Publishing still works.

We'd expect, that once the client connects again, the queued messages get pushed out. However, that does not work. We do see, that the two queues are recreated on connect, however, no messages get published out.

Any help is greatly appreciated.

Ralf Rottmann

unread,
Oct 7, 2016, 8:18:39 AM10/7/16
to rabbitmq-users
One addition: When the subscribing client disconnects, the mqtt-subscription-mosquitto_subqos1 stays, so it remains visible in the Management GUI (as expexted).

Ralf Rottmann

unread,
Oct 7, 2016, 8:22:27 AM10/7/16
to rabbitmq-users
Solved it myself. I was missing a binding.

Michael Klishin

unread,
Oct 7, 2016, 8:25:31 AM10/7/16
to rabbitm...@googlegroups.com
Sticky sessions and QoS 0 make no sense when used together. QoS 0 instructs RabbitMQ to use transient queues, by design. Use QoS 1 if this is not desirable.

On 7 Oct 2016, at 15:18, Ralf Rottmann <ra...@rottmann.net> wrote:

One addition: When the subscribing client disconnects, the mqtt-subscription-mosquitto_subqos1 stays, so it remains visible in the Management GUI (as expexted).

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages