Class MqttV5MessageProducer.Callback

java.lang.Object
de.iip_ecosphere.platform.transport.spring.binder.mqttv5.MqttV5MessageProducer.Callback
All Implemented Interfaces:
MqttClient.ArrivedCallback
Enclosing class:
MqttV5MessageProducer

private class MqttV5MessageProducer.Callback
extends Object
implements MqttClient.ArrivedCallback
The topic-specific reception callback.
Author:
Holger Eichelberger, SSE
  • Constructor Details

  • Method Details

    • messageArrived

      public void messageArrived​(String topic, org.eclipse.paho.mqttv5.common.MqttMessage message)
      Description copied from interface: MqttClient.ArrivedCallback
      This method is called when a message arrives from the server.

      This method is invoked synchronously by the MQTT client. An acknowledgment is not sent back to the server until this method returns cleanly.

      If an implementation of this method throws an Exception, then the client will be shut down. When the client is next re-connected, any QoS 1 or 2 messages will be redelivered by the server.

      Any additional messages which arrive while an implementation of this method is running, will build up in memory, and will then back up on the network.

      If an application needs to persist data, then it should ensure the data is persisted prior to returning from this method, as after returning from this method, the message is considered to have been delivered, and will not be reproducible.

      It is possible to send a new message within an implementation of this callback (for example, a response to this message), but the implementation must not disconnect the client, as it will be impossible to send an acknowledgment for the message being processed, and a deadlock will occur.

      Specified by:
      messageArrived in interface MqttClient.ArrivedCallback
      Parameters:
      topic - name of the topic on the message was published to
      message - the actual message.