Package com.plccom.mqtt.client
Interface MqttMessageListener
-
public interface MqttMessageListenerReceives high-level MQTT application messages for callback subscriptions.Listener methods are invoked sequentially by a client-owned dispatcher thread. This protects the socket reader from direct application callbacks, but the dispatcher queue is bounded and therefore still applies backpressure to MQTT processing when callbacks do not return. Long-running database, file, UI or network work should be handed to an application executor. Runtime exceptions thrown by a listener are caught by the dispatcher so later messages can still be delivered.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonMessage(MqttMessage message)Handles one matching MQTT application message.
-
-
-
Method Detail
-
onMessage
void onMessage(MqttMessage message)
Handles one matching MQTT application message.Implementations should return quickly. Blocking this method for a long time can fill the internal callback queue and eventually delay MQTT ACK, QoS and Keep Alive processing for the connection.
- Parameters:
message- high-level message view with topic, QoS, Retain flag and payload conversion helpers
-
-