Class MQTTPublishManager
- java.lang.Object
-
- org.apache.activemq.artemis.core.protocol.mqtt.MQTTPublishManager
-
public class MQTTPublishManager extends Object
Handles MQTT Exactly Once (QoS level 2) Protocol.
-
-
Constructor Summary
Constructors Constructor Description MQTTPublishManager(MQTTSession session, boolean closeMqttConnectionOnPublishAuthorizationFailure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsendMessage(ICoreMessage message, ServerConsumer consumer, int deliveryCount)Since MQTT Subscriptions can overlap, a client may receive the same message twice.
-
-
-
Constructor Detail
-
MQTTPublishManager
public MQTTPublishManager(MQTTSession session, boolean closeMqttConnectionOnPublishAuthorizationFailure)
-
-
Method Detail
-
sendMessage
protected void sendMessage(ICoreMessage message, ServerConsumer consumer, int deliveryCount) throws Exception
Since MQTT Subscriptions can overlap, a client may receive the same message twice. When this happens the client returns a PubRec or PubAck with ID. But we need to know which consumer to ack, since we only have the ID to go on we are not able to decide which consumer to ack. Instead we send MQTT messages with different IDs and store a reference to original ID and consumer in the Session state. This way we can look up the consumer Id and the message Id from the PubAck or PubRec message id.- Throws:
Exception
-
-