Package io.micronaut.mqtt.bind
Interface MqttBindingContext<T>
- Type Parameters:
T- The message type
- All Known Implementing Classes:
MqttV3BindingContext,MqttV3BindingContext,MqttV5BindingContext,MqttV5BindingContext
@Introspected
public interface MqttBindingContext<T>
A generic context for binding to MQTT messages.
- Since:
- 1.0.0
- Author:
- James Kleeh
-
Method Summary
Modifier and TypeMethodDescriptionvoidAcknowledges a message.intgetId()byte[]intgetQos()getTopic()booleanvoidsetPayload(byte[] payload) Sets the message payload.voidsetQos(int qos) Sets the message qos.voidsetRetained(boolean retained) Sets the message to be retained.voidSets the message topic.
-
Method Details
-
getPayload
byte[] getPayload()- Returns:
- The message payload
-
setPayload
void setPayload(byte[] payload) Sets the message payload.- Parameters:
payload- The payload
-
isRetained
boolean isRetained()- Returns:
- True if the message is retained
-
setRetained
void setRetained(boolean retained) Sets the message to be retained.- Parameters:
retained- The retained flag
-
getQos
int getQos()- Returns:
- The message QOS
-
setQos
void setQos(int qos) Sets the message qos. Must be 0, 1, or 2.- Parameters:
qos- The qos
-
getTopic
String getTopic()- Returns:
- The message topic
-
setTopic
Sets the message topic.- Parameters:
topic- The topic
-
getId
int getId()- Returns:
- The message ID
-
acknowlege
void acknowlege()Acknowledges a message. -
getNativeMessage
T getNativeMessage()- Returns:
- The underlying message instance
-