Class MQTTPublishManager


  • public class MQTTPublishManager
    extends java.lang.Object
    Handles MQTT Exactly Once (QoS level 2) Protocol.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void sendMessage​(org.apache.activemq.artemis.api.core.ICoreMessage message, org.apache.activemq.artemis.core.server.ServerConsumer consumer, int deliveryCount)
      Since MQTT Subscriptions can over lap; a client may receive the same message twice.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MQTTPublishManager

        public MQTTPublishManager​(MQTTSession session)
    • Method Detail

      • sendMessage

        protected void sendMessage​(org.apache.activemq.artemis.api.core.ICoreMessage message,
                                   org.apache.activemq.artemis.core.server.ServerConsumer consumer,
                                   int deliveryCount)
                            throws java.lang.Exception
        Since MQTT Subscriptions can over lap; 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:
        java.lang.Exception