I am using Amazon MQ with the ActiveMQ Classic 5.16.7 engine. My application is using MQTT over WSS connection.
I have topic test/123456
with already created but offline subscriber (client id: sub1
, Qos: 2, CleanSession: false). For this subscriber exists 1333 not received messages. I see these messages in the web console in column ‘Pending Queue Size’.
When absolutely new consumer with new client Id connects to existing topic (Qos 2, CleanSession = false) new consumer receives all 1333 messages (in debug mode I see that all messages has Dup flag false, Retain also false). Don’t understand what’s going on. I reproduce it multiple time.
As mentioned here for new client Id broker creates new session which does not contain old messages and new client id must not receive them.
8
ActiveMQ is a Message Queuing platform that can support the MQTT wire protocol for clients.
When behaving like this it is not being a true MQTT broker, but a Message Queue that will send messages to those client connected via the MQTT wire protocol.
I don’t know how you’ve configured ActiveMQ, but I would guess that if you connect the original client, it would not receive the queued messages because the new client has drained the Queue.
4