All serializers support reading and writing application header properties and JMS header properties.
The difference between the serializers is in how they handle payloads.
BytesMessageSerializer
The
BytesMessageSerializer decodes the body as a sequence of bytes and parses them to create an XML structure according to the payload definition in the event.
The
BytesMessageSerializer is used to receive JMS messages coming in as a stream of uninterrupted bytes in the message body.
Typically,
BytesMessageSerializer is a low level serializer and can have performance implications. Choose the serializer for a defined message type (MapMessage, TextMessage, and so on) that most closely matches the expected usage.
For incoming messages of type JMS BytesMessage, the serializer converts the message bodies to event payloads. The payloads are XML String type, but are not human-readable. However, you can access them using XPath functions. For outgoing events, the serializer converts XML payloads to JMS BytesMessage message bodies.
The
BytesMessageSerializer class is the default serializer.
UtfBytesMessageSerializer
The
UtfBytesMessageSerializer is similar to the
BytesMessageSerializer except that it serializes the payload using
writeUTF() instead of
writeBytes(), and deserializes the payload using
readUTF() instead of
readBytes().
For outgoing events, the serializer converts XML payloads to JMS BytesMessage message bodies.
TextMessageSerializer
The
TextMessageSerializer decodes the text from the message as an XML string.
For incoming messages, the
TextMessageSerializer serializer converts JMS
TextMessage mes using XPath functions. For outgoing events, the serializer converts XML payloads to JMS TextMessage messages.
MessageWithNoBody
The
MessageWithNoBody serializer does not serialize or deserialize the payload.
This serializer corresponds to the BasicMessageSerializer option in TIBCO BusinessEvents Studio.
For outgoing events, the serializer converts the payload to messages of type Message.
See JMS Header Properties in Incoming and Outgoing Messages in
TIBCO BusinessEvents Developer’s Guide.