Apama 10.15.0 | Connecting Apama Applications to External Components | Standard Connectivity Plug-ins | Codec Connectivity Plug-ins | The Base64 codec connectivity plug-in
 
The Base64 codec connectivity plug-in
The Base64 codec performs bidirectional translation between binary payloads and a string that is the Base64-encoding of that payload. The codec is able to operate on arbitrary fields of the message, or the entire payload.
*The field of a message going from the host to the transport should be of byte[] (Java) or buffer_t (C++) type. The Base64 codec encodes the fields of such a message to their Base64-encoding, which will be a java.lang.String (Java) or const char* (C++) type.
*The field of a message going from the transport to the host should be a java.lang.String (Java) or const char* (C++) type in Base64 format. The Base64 codec decodes the fields of such a message to the byte[] (Java) or buffer_t (C++) type.
The Base64 codec follows the MIME (Multipurpose Internet Mail Extensions) specification, which lists Base64 as one of two binary-to-text encoding schemes.
To reference the Base64 codec, an entry such as the following is required in the connectivityPlugins section of the configuration file (see also Configuration file for connectivity plug-ins):
base64Codec:
libraryName: connectivity-base64-codec
class: Base64Codec
You then need to add the Base64 codec into your connectivity chain with the configuration for that instance. An example configuration may look as follows:
startChains:
testChain:
- apama.eventMap
- base64Codec:
eventTypes:
- com.apamax.MyEvent
fields:
- metadata.baz
- payload.foo.asdf
- myTransport
The following configuration options are available for the Base64 codec:
Configuration option
Description
eventTypes
Specifies which event types this codec will handle. Messages with a type that is not listed or where sag.type is not set will be ignored by this codec. If omitted, the codec attempts to encode/decode the payload of all messages.
fields
The list of metadata or payload fields that are to be converted by this codec. Listed field that are not present in the event will be ignored by this codec. It is recommended that you prefix each field with either payload or metadata, for example: payload.myfield or metadata.myfield. If omitted, the codec attempts to encode the entire payload.