Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 5 JMS Channels : Selecting a JMS Serializer

Selecting a JMS Serializer
This section explains the purpose of the provided JMS serializer classes. Choose the serializer that handles the JMS message types that will be sent to the destination you are configuring.
For MapMessage messages, you create properties whose names match the message keys.
All serializers support reading and writing application header properties and JMS header properties. The difference between the serializers is in how they handle payloads.
ByteMessageSerializer decodes the body as a sequence of bytes and parses them to create an XML structure according to the payload definition in the event. UtfBytesMessageSerializer is similar to the ByteMessageSerializer except that it serializes the payload using writeUTF() instead of writeBytes(), and deserializes the payload using readUTF() instead of readBytes(). With TextMessageSerializer, the text from the message is decoded as an XML string. MessageWithNoBody does not serialize or deserialize the payload.
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. TIBCO recommends that you choose the serializer for a defined message type (MapMessage, TextMessage, and so on) that most closely matches the expected usage.
See Using JMS Header Properties in Incoming and Outgoing Messages.
BytesMessageSerializer
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() and deserializes the payload using readUTF().
For outgoing events, the serializer converts XML payloads to JMS BytesMessage message bodies.
TextMessageSerializer
For incoming messages, the TextMessageSerializer serializer converts JMS TextMessage messages to event payloads. The payloads are XML String type, and are human-readable. You can access them 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. For outgoing events, the serializer converts the payload to messages of type Message.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved