Apama 10.2 | Apama Documentation | Connecting Apama Applications to External Components | Standard Connectivity Plug-ins | The MQTT Transport Connectivity Plug-in | Payload for the MQTT message
 
Payload for the MQTT message
As with all other transports, the translation between EPL events and MQTT payloads is based on the choice of host plug-in and codecs. See Host plug-ins and configuration and Codec Connectivity Plug-ins for further information.
The payload for the MQTT message is a byte array. Therefore, the String codec should usually be used to convert a byte[] (Java) or buffer_t (C++) type payload into a hostward string event. The same String codec can also be used to convert a string event to a transportward message with a byte[] or buffer_t type.
The following is a simple example of a YAML configuration file where the payload of the MQTT message will be the string form of the Apama event:
connectivityPlugins:
mqttTransport:
libraryName: connectivity-mqtt
class: MQTTTransport
stringCodec:
libraryName: connectivity-string-codec
class: StringCodec
dynamicChainManagers:
mqttManager:
transport: mqttTransport
managerConfig:
brokerURL: tcp://localhost:1883
dynamicChains:
mqttChain:
- apama.eventString:
suppressLoopback: true
- stringCodec
- mqttTransport

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release