Package software.amazon.awssdk.crt.mqtt
Class MqttMessage
java.lang.Object
software.amazon.awssdk.crt.mqtt.MqttMessage
Represents a message to publish, or a message that was received.
-
Constructor Summary
ConstructorsConstructorDescriptionMqttMessage(String topic, byte[] payload) Deprecated.Use alternate constructor.MqttMessage(String topic, byte[] payload, QualityOfService qos) Constructs a new message.MqttMessage(String topic, byte[] payload, QualityOfService qos, boolean retain) Constructs a new message.MqttMessage(String topic, byte[] payload, QualityOfService qos, boolean retain, boolean dup) Constructs a new message. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetDup()Gets the DUP flag.byte[]Gets the message payloadgetQos()Gets theQualityOfService.booleanGets the retain flag.getTopic()Gets the topic associated with this message
-
Constructor Details
-
MqttMessage
Constructs a new message.- Parameters:
topic- Message topic.payload- Message payload.qos-QualityOfService. When sending, theQualityOfServiceto use for delivery. When receiving, theQualityOfServiceused for delivery.retain- Retain flag. When sending, whether the message should be retained by the broker and delivered to future subscribers. When receiving, whether the message was sent as a result of a new subscription being made.dup- DUP flag. Ignored when sending. When receiving, indicates whether this might be re-delivery of an earlier attempt to send the message.
-
MqttMessage
Constructs a new message.- Parameters:
topic- Message topic.payload- Message payload.qos-QualityOfService. When sending, theQualityOfServiceto use for delivery. When receiving, theQualityOfServiceused for delivery.retain- Retain flag. When sending, whether the message should be retained by the broker and delivered to future subscribers. When receiving, whether the message was sent as a result of a new subscription being made.
-
MqttMessage
Constructs a new message.- Parameters:
topic- Message topic.payload- Message payload.qos-QualityOfService. When sending, theQualityOfServiceto use for delivery. When receiving, theQualityOfServiceused for delivery.
-
MqttMessage
Deprecated.Use alternate constructor.- Parameters:
topic- Message topic.payload- Message payload.
-
-
Method Details
-
getTopic
Gets the topic associated with this message- Returns:
- The topic
-
getPayload
public byte[] getPayload()Gets the message payload- Returns:
- Message payload
-
getQos
Gets theQualityOfService. When sending, theQualityOfServiceto use for delivery. When receiving, theQualityOfServiceused for delivery.- Returns:
- The
QualityOfService
-
getRetain
public boolean getRetain()Gets the retain flag. When sending, whether the message should be retained by the broker and delivered to future subscribers. When receiving, whether the message was sent as a result of a new subscription being made.- Returns:
- Retain flag
-
getDup
public boolean getDup()Gets the DUP flag. Ignored when sending. When receiving, indicates whether this might be re-delivery of an earlier attempt to send the message.- Returns:
- DUP flag
-