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 Translating EPL events using the apama.eventMap host plug-in 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-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback