Package io.vertx.mqtt.messages
Interface MqttPublishMessage
-
- All Superinterfaces:
MqttMessage
public interface MqttPublishMessage extends MqttMessage
Represents an MQTT PUBLISH message
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidack()Send the PUBACK/PUBCOMP to the broker.static MqttPublishMessagecreate(int messageId, MqttQoS qosLevel, boolean isDup, boolean isRetain, String topicName, Buffer payload)Create a concrete instance of a Vert.x publish messagestatic MqttPublishMessagecreate(int messageId, MqttQoS qosLevel, boolean isDup, boolean isRetain, String topicName, Buffer payload, MqttProperties properties)Create a concrete instance of a Vert.x publish messagebooleanisDup()booleanisRetain()Bufferpayload()MqttPropertiesproperties()MqttQoSqosLevel()StringtopicName()-
Methods inherited from interface io.vertx.mqtt.messages.MqttMessage
messageId
-
-
-
-
Method Detail
-
create
static MqttPublishMessage create(int messageId, MqttQoS qosLevel, boolean isDup, boolean isRetain, String topicName, Buffer payload)
Create a concrete instance of a Vert.x publish message- Parameters:
messageId- message identifierqosLevel- quality of service levelisDup- if the message is a duplicateisRetain- if the message needs to be retainedtopicName- topic on which the message was publishedpayload- payload message- Returns:
- Vert.x publish message
-
create
static MqttPublishMessage create(int messageId, MqttQoS qosLevel, boolean isDup, boolean isRetain, String topicName, Buffer payload, MqttProperties properties)
Create a concrete instance of a Vert.x publish message- Parameters:
messageId- message identifierqosLevel- quality of service levelisDup- if the message is a duplicateisRetain- if the message needs to be retainedtopicName- topic on which the message was publishedpayload- payload messageproperties- message properties- Returns:
- Vert.x publish message
-
qosLevel
MqttQoS qosLevel()
- Returns:
- Quality of service level
-
isDup
boolean isDup()
- Returns:
- If the message is a duplicate
-
isRetain
boolean isRetain()
- Returns:
- If the message needs to be retained
-
topicName
String topicName()
- Returns:
- Topic on which the message was published
-
payload
Buffer payload()
- Returns:
- Payload message
-
ack
void ack()
Send the PUBACK/PUBCOMP to the broker. Use this method only if autoAck option is set to false.- Throws:
IllegalStateException- if you are ack a message (with QoS > 0) when the Auto Ack is trueIllegalStateException- if the message is already ack'ed
-
properties
MqttProperties properties()
- Returns:
- MQTT properties
-
-