IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Processing bytes messages with JMS nodes

The default behavior of IBM® Integration Bus when processing bytes messages can affect clients that are designed to use the readUTF() and writeUTF() methods. Construct an equivalent UTF bit stream by using a Compute node.

By default, IBM Integration Bus processes bytes messages by using the readBytes() and writeBytes() JMS methods. By using these methods, the payload is written or read as a raw byte array. For the input message, the behavior is based on the serialization of the message tree; for the output message, the resulting bit stream is passed to the user-specified parser to construct a logical tree.

This behavior can affect clients that are designed to use the readUTF() and writeUTF() methods. A UTF string contains encoded length information as well as the raw bit stream. To construct an equivalent UTF bit stream that can be read by the readUTF() method, complete the following steps.

  1. Add a Compute node immediately before a JMSOutput node.
  2. Double-click the Compute node to open the corresponding ESQL file.
  3. Use the ESQL shown in the following example to construct an equivalent UTF bit stream from an XMLNSC input message. This bit stream can be understood by a client that uses the readUTF() message.
    CALL CopyMessageHeaders();
    
    DECLARE byteData BLOB ASBITSTREAM (InputRoot.XMLNSC ccsid
    InputProperties.CodedCharSetId);
    DECLARE stringData CHARACTER CAST(byteData AS CHARACTER ccsid
    InputProperties.CodedCharSetId );
    DECLARE dataLen INTEGER LENGTH (byteData);
    
    DECLARE blobLen BLOB CAST(dataLen AS BLOB ENCODING
    InputProperties.Encoding);
    DECLARE str2byteBlobLen CHARACTER SUBSTRING (CAST(blobLen AS
    CHARACTER) FROM 15 FOR 4);
    
    SET OutputRoot.BLOB.BLOB = CAST(str2byteBlobLen as BLOB) ||
    byteData ;

bc23530_.htm | Last updated Friday, 21 July 2017