Chapter 2 Working With Channels and Destinations : Selecting a Rendezvous Serializer

Selecting a Rendezvous Serializer
This section explains the behavior of the provided Rendezvous serializer classes.
Note that the Rendezvous serializers use UTF8 encoding.
The type of the event from which the message is serialized is added to the Rendezvous message header using _nm_ and _ns_ fields so that if the message is used in BusinessEvents again, the correct event type is used to deserialize the message (ignoring the default event specified for the destination).
Rendezvous Message Header
For Rendezvous messages, the only header that BusinessEvents interprets is _sendsubject_ which is of type String. It is a read-only property. The event has to define this property to receive the value. The value is the actual Subject on which the message was sent.
Basic Serializer
The basic serializer, TibRvMsgSerializer serializer, is for efficient handling of events and messages that do not have payloads. It ignores payloads in messages and in events if any exist. (See Including a Payload in a Rendezvous Message.)
If you want pass payloads between the _payload_ field of a Rendezvous message and an event payload, use the TibRvMsgSerializerWithXMLPayload serializer (see Serializer For Events With Payloads).
First level Rendezvous property values are used as values for matching event properties. Any additional (non-matching) Rendezvous properties are ignored.
Serializer For Events With Payloads
The TibRvMsgSerializerWithXMLPayload serializer allows you to move XML documents between Rendezvous message _payload_ fields and event payloads.
If the _payload_ field is of an unsupported type, or is missing, or if the event has not been configured for a payload, the payload is ignored.
Deserializing from Rendezvous Message to Event
First level Rendezvous property values are used as values for matching event properties. Any additional (non-matching) Rendezvous properties are ignored.
The _payload_ field contents are passed into the event payload. TIBRVMSG_STRING, and TIBRVMSG_XML (wire format types) are supported.
If the event defines a payload, but the incoming Rendezvous message does not have a _payload_ field, BusinessEvents attempts to map the entire message as the payload.
Serializing from Event to Rendezvous message
Including a Payload in a Rendezvous Message
To include a payload in a Rendezvous message, ensure that the message has this field:
_payload_
When BusinessEvents receives a Rendezvous message with this field, and when you use the TibRvMsgSerializerWithXMLPayload serializer, BusinessEvents deserializes the content of the field into the payload of the simple event.
The Rendezvous _payload_ field can be of these types: String, byte array, or TibrvXML.