Class MqttHeaderMapper

java.lang.Object
org.springframework.integration.mqtt.support.MqttHeaderMapper
All Implemented Interfaces:
HeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties>

public class MqttHeaderMapper extends Object implements HeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties>
The default HeaderMapper implementation for MQTT v5 message properties mapping.
Since:
5.5.5
Author:
Artem Bilan
  • Constructor Details

    • MqttHeaderMapper

      public MqttHeaderMapper()
  • Method Details

    • setInboundHeaderNames

      public void setInboundHeaderNames(String... inboundHeaderNames)
      Provide a list of patterns to map MQTT message properties into message headers. By default, it maps all valid MQTT PUBLISH packet headers (see MqttPublish), including all the user properties.
      Parameters:
      inboundHeaderNames - the MQTT message property patterns to map.
    • setOutboundHeaderNames

      public void setOutboundHeaderNames(String... outboundHeaderNames)
      Provide a list of patterns to map header into a PUBLISH MQTT message. Default headers are: MessageHeaders.CONTENT_TYPE, MqttHeaders.MESSAGE_EXPIRY_INTERVAL, MqttHeaders.RESPONSE_TOPIC, MqttHeaders.CORRELATION_DATA.
      Parameters:
      outboundHeaderNames - the header patterns to map.
    • fromHeaders

      public void fromHeaders(MessageHeaders headers, org.eclipse.paho.mqttv5.common.packet.MqttProperties target)
      Specified by:
      fromHeaders in interface HeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties>
    • toHeaders

      public Map<String,Object> toHeaders(org.eclipse.paho.mqttv5.common.packet.MqttProperties source)
      Specified by:
      toHeaders in interface HeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties>