Apama 10.15.0 | Connecting Apama Applications to External Components | Standard Connectivity Plug-ins | The Universal Messaging Transport Connectivity Plug-in | Configuring the Universal Messaging connectivity plug-in | Supported payloads
 
Supported payloads
The Universal Messaging transport supports different types of Apama message payload:
*Binary payloads (Java byte[] or C++ buffer_t) . Apama messages with binary payloads are mapped to the data payload of a Universal Messaging message. Optionally, Universal Messaging message properties/headers (nEventProperties) may be mapped using metadata values in string form with the prefix um.properties. You can also map all of the Universal Messaging message properties to an EPL dictionary with a Mapper codec rule that moves metadata.um.properties in its entirety; see also The Mapper codec connectivity plug-in. If you wish to put a string into the Universal Messaging message data payload, use the String codec to convert it into binary form (as UTF-8); see also The String codec connectivity plug-in.
*Map payloads (Java Map or C++ map_t) . Apama messages with a map payload are mapped to the Universal Messaging message properties/headers (nEventProperties), and the Universal Messaging message data payload is empty.
If you are sending and receiving using the eventMap host plug-in (see also Translating EPL events using the apama.eventMap host plug-in), you probably want to make use of the Mapper and Classifier codecs (see Codec Connectivity Plug-ins), unless the Apama event type name is stored in the tag of the Universal Messaging messages. Typically, the Apama event format does not match exactly to the format you want in the nEventProperties, and the Mapper codec allows you to fix that.
When setting nEventProperties either from the map payload or via um.properties metadata values, the following EPL types are unsupported and sending events to Universal Messaging will therefore fail:
*dictionary<> types with keys which are not Apama primitives (that is, anything except integer, boolean, decimal, float, string). For example, dictionary<Sequence<some type>, String> is not supported, but dictionary<decimal, <sometype>> is supported.
*Apama decimal type and dictionary<> keys are stringified when sending the events. That also means that sequence <decimal> is sent as a sequence of strings.
*Sequences within sequences . For example, sequence<sequence<any type>>. Note that sequence <Apama Event> or sequence <dictionary<some primitive, any type>> are supported.
The binary payload may represent a string. If this is a case, then the binary payload must be converted to a string payload before further processing can happen as a string. To do this, use the String codec. This converts binary payloads to string payloads for hostward messages and string payloads to binary payloads for transportward messages. The String codec should be the last codec in the chain. See The String codec connectivity plug-in for detailed information.
You can also use other codecs such as the JSON codec (see Codec Connectivity Plug-ins for more information). For example:
dynamicChains:
UMJsonChain:
- apama.eventMap:
suppressLoopback: true
description: "@{um.rnames}"
remoteAddress: "@{um.rnames}"
- jsonCodec
- stringCodec
- UMTransport:
channelPattern: ".*"