Rafael Pimenta
Rafael Pimenta

Reputation: 132

When MQTT QoS1 message that does not have a consumer is physically removed from the ActiveMQ?

When a message (MQTT (3.1) QoS1) that does not have a client consuming the underlying topic is physically removed from the KahaDB ActiveMQ (5.15) database?

Example 01:

  1. MQTT (3.1) message with content "foo" with QoS1 sent to the topic "topic-foo".
  2. Broker is ActiveMQ 5.15 and received the message
  3. There is no consumer to the topic "topic-foo"
  4. Message is not dequeued from the broker.
  5. When the message will be removed from the KahaDB physically?

Example 02:

  1. MQTT (3.1) message with content "foo" with QoS1 sent to the topic "topic-foo".
  2. Broker is ActiveMQ 5.15 and received the message
  3. There is a consumer to the topic "topic-foo" over a ClientAcknowledge mode session.
  4. Message is received by the consumer, however, is not acknowledged for any reason.
  5. Message is not dequeued from the broker.
  6. When the message will be removed from the KahaDB physically?

Upvotes: 0

Views: 92

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 35008

When there is no consumer/subscriber on a topic and a message is sent to that topic then the message is simply discarded. It is never actually stored on disk physically.

When there is a consumer/subscriber on a topic and a message is sent to that topic then the message will be physically stored on disk and only removed when that message is acknowledged.

Upvotes: 0

Related Questions