Native_schema element
In the JMS toolkit, the <native_schema> element specifies the data attributes of the data that is received from or sent to WebSphere MQ or Apache ActiveMQ. For example, the <native_schema> element identifies the attribute names, data types, and optionally their length.
The following example is an abridged access specification that contains a <native_schema> element:
<access_specification name="OutTrading">
<destination identifier="TestDestination"
delivery_mode="persistent" message_class="map" />
...
<native_schema>
<attribute name="id" type="Int" />
<attribute name="fname" type="String" />
<attribute name="lname" type="String" />
</native_schema>
</access_specification>
The <native_schema> element has no attributes; it has <attribute> elements.
Attribute element
The <attribute> element specifies information about the attributes that are present in an output JMS message, or are expected in an input 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 JMS 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. 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.
- JMSSource
- 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. For the length attribute, the operator handles data based on the message class and the data type:
- type
- This mandatory attribute specifies the data type of the attribute.
- The following table lists the data types that can be used in the access specifications for the JMSSink and JMSSource operators. It also lists the corresponding SPL types for each JMS type.
SPL type JMS type based on message class map stream bytes xml wbe wbe22 =================================================================== int8 Byte Byte Byte String String String uint8 Byte Byte Byte String String String int16 Short Short Short String String String uint16 Short Short Short String String String int32 Int Int Int String String String uint32 Int Int Int String String String int64 Long Long Long String String String uint64 Long Long Long String String String float32 Float Float Float String String String float64 Double Double Double String String String boolean Boolean Boolean Boolean String String String blob* Bytes Bytes Bytes String Not supported Not supported rstring* String String Bytes String String String decimal32 String String Bytes String String String decimal64 String String Bytes String String String decimal128 String String Bytes String String String timestamp* String String Bytes String String String ustring String String Bytes String String String
- NOTE:
- The blob SPL type is not supported for message classes wbe and wbe22 by the JMSSink operator. The blob data type is not supported by JMSSource operator.
- The information for the rstring SPL type assumes that you use UTF-8 encoding.
- The information for the timestamp SPL type assumes that you use the 1970 UNIX epoch.
- The following SPL data types are not supported by the JMS toolkit operators:
- enum
- complexb
- composite types
- xml
- NOTE: