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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fromHeaders
(MessageHeaders headers, org.eclipse.paho.mqttv5.common.packet.MqttProperties target) void
setInboundHeaderNames
(String... inboundHeaderNames) Provide a list of patterns to map MQTT message properties into message headers.void
setOutboundHeaderNames
(String... outboundHeaderNames) Provide a list of patterns to map header into a PUBLISH MQTT message.toHeaders
(org.eclipse.paho.mqttv5.common.packet.MqttProperties source)
-
Constructor Details
-
MqttHeaderMapper
public MqttHeaderMapper()
-
-
Method Details
-
setInboundHeaderNames
Provide a list of patterns to map MQTT message properties into message headers. By default, it maps all valid MQTT PUBLISH packet headers (seeMqttPublish
), including all the user properties.- Parameters:
inboundHeaderNames
- the MQTT message property patterns to map.
-
setOutboundHeaderNames
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 interfaceHeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties>
-
toHeaders
- Specified by:
toHeaders
in interfaceHeaderMapper<org.eclipse.paho.mqttv5.common.packet.MqttProperties>
-