Interface MqttMessageConverter

All Superinterfaces:
org.springframework.messaging.converter.MessageConverter
All Known Implementing Classes:
DefaultPahoMessageConverter

public interface MqttMessageConverter
extends org.springframework.messaging.converter.MessageConverter
Extension of MessageConverter allowing the topic to be added as a header.
Since:
4.0
  • Method Summary

    Modifier and Type Method Description
    static org.springframework.integration.handler.MessageProcessor<java.lang.Integer> defaultQosProcessor()  
    static org.springframework.integration.handler.MessageProcessor<java.lang.Boolean> defaultRetainedProcessor()  
    default org.springframework.messaging.Message<?> toMessage​(java.lang.String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
    Convert to a Message.
    org.springframework.integration.support.AbstractIntegrationMessageBuilder<?> toMessageBuilder​(java.lang.String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
    Convert to a message builder.

    Methods inherited from interface org.springframework.messaging.converter.MessageConverter

    fromMessage, toMessage
  • Method Details

    • toMessage

      default org.springframework.messaging.Message<?> toMessage​(java.lang.String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
      Convert to a Message. The default implementation calls toMessageBuilder(String, MqttMessage).
      Parameters:
      topic - the topic.
      mqttMessage - the MQTT message.
      Returns:
      the Message.
    • toMessageBuilder

      org.springframework.integration.support.AbstractIntegrationMessageBuilder<?> toMessageBuilder​(java.lang.String topic, org.eclipse.paho.client.mqttv3.MqttMessage mqttMessage)
      Convert to a message builder.
      Parameters:
      topic - the topic.
      mqttMessage - the MQTT message.
      Returns:
      the builder.
    • defaultQosProcessor

      static org.springframework.integration.handler.MessageProcessor<java.lang.Integer> defaultQosProcessor()
    • defaultRetainedProcessor

      static org.springframework.integration.handler.MessageProcessor<java.lang.Boolean> defaultRetainedProcessor()