The <attribute> element specifies information about the attributes that are present in an output XMS or JMS message, or are expected in an input XMS or JMS message.
The <attribute> element has three possible attributes:
- name
- This mandatory attribute specifies the name by which the attribute is known in the message. The Messaging Toolkit operators use these identifiers exactly as specified to access data in the message. For example, the operators do not change the case of the identifiers.
- length
- The length attribute specifies the maximum length of the attribute. The length attribute is required only for String and Bytes data types. If the length attribute is specified for other data types, the JMSSink and JMSSource operators generate a run time error, and the XMSSink and XMSSource operators generate a compile-time error. For the length attribute, the operator handles data based on the message class and the data type:
- JMSSource
- If the message class is bytes and String data in the message is smaller than the length specified in the native schema, the message is discarded.
- For map and stream message classes, the length attribute has no significance.
- The Blob data type is not supported.
- JMSSink
- If the message class is bytes and String data in the tuple is smaller than the length specified in the native schema, the String data is padded with spaces to fit the length. For other message classes, the String data is written as is.
- If the String data in the tuple is longer than the length specified in the native schema and the message class is either map, stream, bytes, xml, wbe, or wbe22, the String data is truncated.
- If the message class is bytes and Bytes data in the tuple is smaller than the length specified in the native schema, the Bytes data is padded with null values to fit the length. For other message classes, the Bytes data is written as is.
- If the Blob data in the tuple is longer than the length specified in the native schema and the message class is either map, stream, bytes, or xml, the Blob data is truncated. For message classes wbe and wbe22, Blob data type is not supported.
- XMSSource
- If the message class is bytes and the String or Bytes data in the message is smaller than the length specified in the native schema, the message is discarded.
- If the message class is map or stream, the length attribute is ignored for String data.
- If the message class is map or stream and the Bytes data in the message is smaller than the length specified in the native schema, the Bytes data is padded with null values to fit the length.
- If the message class is map or stream and the Bytes data is in the message is longer than the length specified in the native schema, the Bytes data is truncated to fit the length.
- XMSSink
- If the message class is bytes and the String data in the tuple is smaller than the length specified in the native schema, the String data is padded with spaces to fit the length. For other message classes the String data is written as is.
- If the String data in the tuple is longer than the length specified in the native schema and the message class is either map, stream, bytes, or xml, the String data is truncated.
- If the message class is bytes and the Bytes data in the tuple is smaller than the length specified in the native schema, the Bytes data is padded with null values to fit the length. For other message classes the Bytes data is written as is.
- If the Blob data in the tuple is longer than the length specified in the native schema and the message class is either map, stream, bytes, or xml, the Blob data is truncated. For message classes wbe and wbe22, Blob data is not supported.
- type