Interface MqttMessage<T>
-
- All Superinterfaces:
Message<T>
- All Known Implementing Classes:
ReceivingMqttMessage,SendingMqttMessage
public interface MqttMessage<T> extends Message<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intgetMessageId()io.netty.handler.codec.mqtt.MqttQoSgetQosLevel()StringgetTopic()booleanisDuplicate()booleanisRetain()static <T> MqttMessage<T>of(String topic, T payload)Create a message with the given payload and metadata.static <T> MqttMessage<T>of(String topic, T payload, io.netty.handler.codec.mqtt.MqttQoS qos)static <T> MqttMessage<T>of(String topic, T payload, io.netty.handler.codec.mqtt.MqttQoS qos, boolean retain)static <T> MqttMessage<T>of(String topic, T payload, Supplier<CompletionStage<Void>> ack)Create a message with the given payload, metadata and ack function.static <T> MqttMessage<T>of(T payload)Create a message with the given payload.default MqttMessage<T>withAck(Supplier<CompletionStage<Void>> ack)Creates a new instance ofMessagewith the given acknowledgement supplier.-
Methods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
ack, addMetadata, getAck, getMetadata, getMetadata, getNack, getPayload, nack, unwrap, withMetadata, withMetadata, withNack, withPayload
-
-
-
-
Method Detail
-
of
static <T> MqttMessage<T> of(T payload)
Description copied from interface:MessageCreate 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:MessageCreate 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 benull.payload- The metadata, ifnullan 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:MessageCreate 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 benull.payload- the metadata, ifnull, empty metadata are used.ack- The ack function, this will be invoked when the returned messagesMessage.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
-
getMessageId
int getMessageId()
-
getQosLevel
io.netty.handler.codec.mqtt.MqttQoS getQosLevel()
-
isDuplicate
boolean isDuplicate()
-
isRetain
boolean isRetain()
-
getTopic
String getTopic()
-
-