Interface MqttMessageHandler
-
public interface MqttMessageHandler
-
-
Field Summary
Fields Modifier and Type Field Description static MqttMessageHandlerNoOpHandlerdo nothing when message received, just print log
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonMessage(MqttConnection connection, java.lang.String topic, io.rapidw.mqtt.codec.v3_1_1.MqttV311QosLevel qos, boolean retain, boolean dupFlag, java.lang.Integer packetId, byte[] payload)will be called when new message from subscribed topic received
-
-
-
Field Detail
-
NoOpHandler
static final MqttMessageHandler NoOpHandler
do nothing when message received, just print log
-
-
Method Detail
-
onMessage
void onMessage(MqttConnection connection, java.lang.String topic, io.rapidw.mqtt.codec.v3_1_1.MqttV311QosLevel qos, boolean retain, boolean dupFlag, java.lang.Integer packetId, byte[] payload)
will be called when new message from subscribed topic received- Parameters:
connection- the mqtt connectiontopic- topicqos- QoS levelretain- retaindupFlag- dup for Qos 1 or 2. For QoS 0, this parameter should be ignoredpacketId- packetId for QoS 1 or 2. For QoS 0, this parameter should be ignoredpayload- payload
-
-