Interface MqttMessage<T>

    • Method Detail

      • of

        static <T> MqttMessage<T> of​(T payload)
        Description copied from interface: Message
        Create a message with the given payload. No metadata are associated with the message, the acknowledgement and negative acknowledgement are immediate.
        Type Parameters:
        T - The type of payload
        Parameters:
        payload - The payload.
        Returns:
        A message with the given payload, no metadata, and no-op ack and nack functions.
      • of

        static <T> MqttMessage<T> of​(String topic,
                                     T payload)
        Description copied from interface: Message
        Create a message with the given payload and metadata. The acknowledgement and negative-acknowledgement are immediate.
        Type Parameters:
        T - The type of payload
        Parameters:
        topic - The payload, must not be null.
        payload - The metadata, if null an empty set of metadata is used.
        Returns:
        A message with the given payload, metadata and no-op ack and nack functions.
      • of

        static <T> MqttMessage<T> of​(String topic,
                                     T payload,
                                     Supplier<CompletionStage<Void>> ack)
        Description copied from interface: Message
        Create a message with the given payload, metadata and ack function. Negative-acknowledgement is immediate.
        Type Parameters:
        T - the type of payload
        Parameters:
        topic - The payload, must not be null.
        payload - the metadata, if null, empty metadata are used.
        ack - The ack function, this will be invoked when the returned messages Message.ack() method is invoked.
        Returns:
        A message with the given payload and ack function.
      • of

        static <T> MqttMessage<T> of​(String topic,
                                     T payload,
                                     io.netty.handler.codec.mqtt.MqttQoS qos)
      • of

        static <T> MqttMessage<T> of​(String topic,
                                     T payload,
                                     io.netty.handler.codec.mqtt.MqttQoS qos,
                                     boolean retain)
      • withAck

        default MqttMessage<T> withAck​(Supplier<CompletionStage<Void>> ack)
        Description copied from interface: Message
        Creates a new instance of Message with the given acknowledgement supplier. The payload, metadata and nack function are taken from the current Message.
        Specified by:
        withAck in interface Message<T>
        Parameters:
        ack - the acknowledgement supplier
        Returns:
        the new instance of Message
      • getMessageId

        int getMessageId()
      • getQosLevel

        io.netty.handler.codec.mqtt.MqttQoS getQosLevel()
      • isDuplicate

        boolean isDuplicate()
      • isRetain

        boolean isRetain()