This topic contains an overview and procedures for creating meta-objects.
The connector uses meta-object entries to determine which business object to associate with a message. The type of business object and verb used in processing an event message is based on the FORMAT field contained in the WebSphere MQ message header. You construct a meta-object attribute to store the business object name and verb to associate with the WebSphere MQ message header FORMAT field text. Meta-object attributes also contain message processing guidelines.
When a message is retrieved from the input queue, the connector looks up the business object name associated with the FORMAT text field. The message, along with the business object name, is then passed to the data handler. If a business object is successfully populated with message content, the connector checks to see if it is subscribed, and then delivers it to the integration broker using the gotApplEvents() method.
The connector for WebSphere Business Integration Message Broker can recognize and read two kinds of meta-objects:
The attribute values of the dynamic child meta-object duplicate and override those of the static meta-object.
When deciding upon which meta-object will work best for your implementation, consider the following:
Table 15 provides a complete list of properties supported in meta-objects. Refer to these properties when implementing meta-objects. Your meta object should have one or more of the properties shown in Table 15.
Not all properties are available in both static and dynamic meta-objects. Nor are all properties are readable from or writable to the message header. See the appropriate sections on event and request processing in Overview, to determine how a specific property is interpreted and used by the connector.
Table 15. WBI Message Broker adapter meta-object properties
Property name | Definable in static meta-object | Definable in dynamic meta-object | Description |
---|---|---|---|
DataHandlerConfigMO | Yes | Yes | Meta-object passed to data handler to provide configuration information. If specified in the static meta-object, this will override the value specified in the DataHandlerConfigMO connector property. Use this meta-object property when different data handlers are required for processing different business object types. Use the dynamic child meta-object for request processing when the data format may be dependent on the actual business data. The specified business object must be supported by the connector agent. See the description in Appendix B, Connector-specific properties for the WBI Message Broker adapter. |
DataHandlerMimeType | Yes | Yes | Allows you to request a data handler based on a particular MIME type. If specified in the meta-object, this will override the value specified in the DataHandlerMimeType connector property. Use this meta-object property when different data handlers are required for processing different business object types. Use the dynamic child meta-object for request processing when the data format might be dependent on the actual business data. The business object specified in DataHandlerConfigMO should have an attribute that corresponds to the value of this property. See the description in Appendix B, Connector-specific properties for the WBI Message Broker adapter. |
DataHandlerClassName | Yes | Yes | See the description in Appendix B, Connector-specific properties for the WBI Message Broker adapter. |
InputFormat | Yes | Yes | Format or type of inbound (event) message to associate with the given business object. This value helps identify the message content and is specified by the application that generated the message. When a message is retrieved and is in this format, it is converted to the given business object, if possible. If this format is not specified for a business object, the connector does not handle subscription deliveries for the given business object. Do not set this property using default meta-object conversion properties; its value is used to match incoming messages to business objects. The field that the connector considers as defining the format in the message can be user-defined via the connector-specific property MessageFormatProperty. |
OutputFormat | Yes | Yes | Format to be populated in outbound messages. If the OutputFormat is not specified, the input format is used, if available. |
InputQueue
| Yes | Yes | The input queue that the connector polls to detect new messages.
This property is used to match incoming messages to business objects
only. Do not set this property using default conversion
properties; its value is used to match incoming messages to business
objects.
|
OutputQueue | Yes | Yes | Queue to which messages derived from the given business object are delivered. |
ResponseTimeout | Yes | Yes | Indicates the length of time in milliseconds to wait before timing out when waiting for a response in synchronous request processing. The connector returns SUCCESS immediately without waiting for a response if this is left undefined or with a value less than zero. |
TimeoutFatal | Yes | Yes | Used in synchronous request processing to trigger the connector to return an error message if a response is not received. If this property is True, the connector returns APPRESPONSETIMEOUT to the broker when a response is not received within the time specified by ResponseTimeout. If this property is undefined or set to False, then on a response timeout the connector fails the request but does not terminate. Default = False. |
Below are fields mapping specifically to the JMS message header. For specific explanations, interpretation of values, and more, see the JMS API specification. JMS providers may interpret some fields differently so also check your JMS provider documentation for any deviations. | |||
ReplyToDestination
|
| Yes | Destination to which a response message for a request is to be sent. |
Type |
| Yes | Type of message. Generally user-definable, depending on JMS provider. |
MessageID |
| Yes | Unique ID for message (JMS provider specific). |
CorrelationID | Yes | Yes | Used in response messages to indicate the ID of the request message that initiated this response. |
Delivery Mode | Yes | Yes | Specifies whether the message is persisted or not in the MOM
system. Acceptable values:
1=non-persistent 2=persistent Other values, depending on the JMS provider, may be available. |
Priority |
| Yes | Numeric priority of message. Acceptable values: 0 through 9 inclusive (low to high priority). |
Destination |
| Yes | Current or last (if removed) location of message in MOM system. |
Expiration |
| Yes | Time-to-live of message. |
Redelivered |
| Yes | Indicates that the JMS provider most likely attempted to deliver the message to the client earlier but receipt was not acknowledged. |
Timestamp |
| Yes | Time message was handed off to JMS provider. |
UserID |
| Yes | Identity of the user sending the message. |
AppID |
| Yes | Identity of the application sending the message. |
DeliveryCount |
| Yes | Number of delivery attempts. |
GroupID |
| Yes | Identity of the message group. |
GroupSeq |
| Yes | Sequence of this message in the message group specified in GroupID. |
JMSProperties |
| Yes | See JMS properties. |
The WebSphere Business Integration Message Broker configuration meta-object consists of a list of conversion properties defined for different business objects. To view a sample static meta-object, launch Business Object Designer and open the following sample that is shipped with the adapter: connectors\WBIMB\samples\LegacyItem\Sample_WBIMB_MO_Config.xsd
The connector supports at most one static meta-object at any given time. You implement a static meta-object by specifying its name for connector property ConfigurationMetaObject
The structure of the static meta-object is such that each attribute represents a single business object and verb combination and all the meta-data associated with processing that object. The name of each attribute should be the name of the business object type and verb separated by an underscore, such as Customer_Create. The attribute application-specific information should consist of one or more semicolon-delimited name-value pairs representing the meta-data properties you want to specify for this unique object-verb combination.
Table 16. Static meta-object structure
Attribute name | Application-specific text |
---|---|
<business object type>_<verb> |
property=value;property=value;... |
<business object type>_<verb> |
property=value;property=value;... |
For example, consider the following meta-object:
Table 17. Sample static meta-object structure
Attribute name | Application-specific information |
---|---|
Customer_Create |
OutputFormat=CUST;OutputDestination=QueueA |
Customer_Update |
OutputFormat=CUST;OutputDestination=QueueB |
Order_Create |
OutputFormat=ORDER;OutputDestination=QueueC |
The meta-object in this sample informs the connector that when it receives a request business object of type Customer with verb Create, to convert it to a message with format CUST and then to place it in destination QueueA. If the customer object instead had verb Update, the message would be placed in QueueB. If the object type was Order and had verb Create, the connector would convert and deliver it with format ORDER to QueueC. Any other business object passed to the connector would be treated as unsubscribed.
Optionally, you may name one attribute Default and assign to it one or more properties in the ASI. For all attributes contained in the meta-object, the properties of the default attribute are combined with those of the specific object-verb attributes. This is useful when you have one or more properties to apply universally (regardless of object-verb combination). In the following example, the connector would consider object-verb combinations of Customer_Create and Order_Create as having OutputDestination=QueueA in addition to their individual meta-data properties:
Table 18. Sample static meta-object structure
Attribute name | Application-specific information |
---|---|
Default |
OutputDestination=QueueA |
Customer_Update |
OutputFormat=CUST |
Order_Create |
OutputFormat=ORDER |
Table 15 describes the properties that you can specify as application-specific information in the static meta-object.
To implement a static meta-object, do the following:
You can use the InputQueue property in the application-specific information of the static meta-object to associate a data handler with an input queue. This feature is useful when dealing with multiple trading partners who have different formats and conversion requirements.
To map a data handler to an InputQueue, do the following:
For example, the following attribute in a static meta-object associates a data handler with an InputQueue named CompReceipts:
[Attribute] Name = Cust_Create Type = String Cardinality = 1 MaxLength = 1 IsKey = false IsForeignKey = false IsRequired = false AppSpecificInfo = InputQueue=//queue.manager/CompReceipts;DataHandlerClassName= com.crossworlds.DataHandlers.WBIMB.disposition_notification;DataHandlerMimeType= message/ disposition_notification IsRequiredServerBound = false [End]
If it is difficult or unfeasible to specify the necessary metadata through a static meta-object, the connector can optionally accept meta-data delivered at run-time for each business object instance.
Dynamic meta-objects allow you to change the meta-data used by the connector to process a business object on a per-request basis during request processing, and to retrieve information about an event message during event processing.
The connector recognizes and reads conversion properties from a dynamic meta-object that is added as a child to the top-level business object passed to the connector. The attribute values of the dynamic child meta-object duplicate the conversion properties that you can specify via the static meta-object that is used to configure the connector.
Since dynamic child meta object properties override those found in static meta-objects, if you specify a dynamic child meta-object, you need not include a connector property that specifies the static meta-object. Accordingly, you can use a dynamic child meta-object independently of the static meta-object and vice-versa.
Table 15 describes the properties that you can specify as application-specific information in the dynamic meta-object.
The following attributes, which reflect JMS and WebSphere MQ header
properties, are recognized in the dynamic meta-object.
Read-only attributes are read from a message header during event notification and written to the dynamic meta-object. These properties also populate the dynamic MO when a response message is issued during request processing. Read/write attributes are set on message headers created during request processing. During event notification, read/write attributes are read from message headers to populate the dynamic meta-object.
The structure of the dynamic meta-object is such that each attribute represents a single metadata property and value: meta-object property name =meta-object property value
In order to provide collaborations with more information regarding messages retrieved during polling, the connector populates specific attributes of the dynamic meta-object, if already defined for the business object created.
Table Table 20 shows how a dynamic child meta-object might be structured
for polling.
Table 20. Dynamic child meta-object structure for polling
Property name | Sample value |
---|---|
InputFormat | CUST_IN |
InputQueue | MYInputQueue |
OutputFormat | CxIgnore |
OutputQueue | CxIgnore |
ResponseTimeout | CxIgnore |
TimeoutFatal | CxIgnore |
As shown in Table 20, you can define additional attributes, Input_Format and InputQueue, in a dynamic child meta-object. The Input_Format is populated with the format of the message retrieved, while the InputQueue attribute contains the name of the queue from which a given message has been retrieved. If these properties are not defined in the child meta-object, they will not be populated.
Example scenario:
You can add attributes to a dynamic meta-object to gain more information about, and more control over, the message transport. This section describes these attributes and how they affect event notification and request processing.
Unlike other attributes in the dynamic meta-object, JMSProperties must define a single-cardinality child object. Every attribute in this child object must define a single property to be read/written in the variable portion of the JMS message header as follows:
The table below shows application-specific information properties that you must define for attributes in the JMSProperties object.
Table 21. Application-specific information for JMS property attributes
Attribute | Possible values | ASI | Comments |
---|---|---|---|
Name | Any valid JMS property name (valid = compatible with type defined in ASI) | name=<JMS property name>;type=<JMS property type> | Some vendors reserve certain properties to provide extended functionality. In general, users should not define custom properties that begin with JMS unless they are seeking access to these vendor-specific features. |
Type | String | type=<see comments> | This is the type of the JMS property. The JMS API provides a number of methods for setting values in the JMS Message: setIntProperty, setLongProperty, setStringProperty, etc. The type of the JMS property specified here dictates which of these methods is used for setting the property value in the message. |
In the example below, a JMSProperties child object is defined for the Customer object to allow access to the user-defined fields of the message header:
Customer (ASI = cw_mo_conn=MetaData) |-- Id |-- FirstName |-- LastName |-- ContactInfo |-- MetaData |-- OutputFormat = CUST |-- OutputDestination = QueueA |-- JMSProperties |-- RoutingCode = 123 (ASI= name=RoutingCode;type=Int) |-- Dept = FD (ASI= name=RoutingDept;type=String)
To illustrate another example, Figure 4 shows attribute JMSProperties in the dynamic meta-object and definitions for four properties in the JMS message header: ID, GID, RESPONSE and RESPONSE_PERSIST. The application-specific information of the attributes defines the name and type of each. For example, attribute ID maps to JMS property ID of type String).
Figure 4. JMS properties attribute in a dynamic meta-object
To implement a dynamic meta-object, do the following:
Customer (ASI = cw_mo_conn=MetaData) |-- Id |-- FirstName |-- LastName |-- ContactInfo |-- MetaData |-- OutputFormat = CUST |-- OutputDestination = QueueA
Upon receipt of a request populated as shown above, the connector would convert the Customer object to a message with format CUST and then put the message in queue QueueA.