Understanding Outbound Messaging
Successful outbound messaging relies on sending messages in the proper order and on testing the messages. Messages containing non-XML data have special considerations.
Message Order
PeopleSoft Integration Broker guarantees that messages are delivered in the order in which you send them and that they are single-threaded at the PeopleSoft receiving node. However, message order is not part of the queue definition. You must send messages in the proper order.
Note:
You can modify this behavior by using queue partitioning.
Message Testing
Make sure that you adequately unit-test and system-test your messages.
Unit-test a message by triggering the PeopleCode that sends the message and then view the message details in Service Operations Monitor. From the Service Operations Monitor, you can view the contents of each field to verify that the message data is formatted correctly.
See the product documentation for Integration Broker Service Operations Monitor.
You can also test handler code using the Handler Tester utility. See the product documentation for Integration Broker Testing Utilities and Tools for more information.
Message Class Outbound PeopleCode
Use the record class SelectByKey method whenever possible to get data that isn’t in the component buffer.
If the record names are the same, use the standard record methods, such as SelectByKey, Insert, and Update, on the message records.
There are no automatic checks for message size. You must do it programmatically. Use the following code at level 0 to control message size when dealing with multiple transactions:
If &Msg.Size > %MaxMessageSize
Note:
The OnRouteSend method enables you to apply PeopleCode that filters the destination nodes.
Non-XML Data
If you’re generating a non-XML outbound message, it’s up to you to insert the message content into a special XML section containing a CDATA tag:
<xml psnonxml="yes">
<![CDATA[nonXML_message_data]]>
Outbound Messaging and Global Variables
When you invoke a SyncRequest method the system clears any declared global variables after OnRouteSend or OnSend PeopleCode events are fired. If a component attempts to access any of the global variables after the SyncRequest method, a context error occurs.
OnRouteSend and OnSend events are primarily used for asynchronous messaging, however they can be use for synchronous messages.
To avoid context errors when using OnRouteSend or OnSend events for synchronous messaging, following these guidelines:
-
Do not use global variables.
-
If you must use global variables, save them as temporary variables prior to executing a SyncRequest event, then after the event is fired re-assign them back to the globals.
-
Run OnRouteSend or OnSend logic prior to the SyncRequest and after the node is obtained use sender-specific routing. In sender-specific routing you pass the node as part of the SyncRequest call. This will send the request to the node as long as there is an active routing. Any connector overrides can be performed prior to the SyncRequest call and set on the message.