FirstCorrelation method: Message class
Syntax
FirstCorrelation()
Description
Use this method within an Integration Broker OnPreNotify event on the subscribing node to determine if this is the first message with this correlation ID.
Parameters
None.
Returns
A Boolean value: True if this is the first message with this correlation ID, False if a previous message with the same correlation ID has already run the OnPreNotify event.
Example
To improve the performance of correlated messages with multiple segments, use the FirstCorrelation method to run the OnPreNotify event for the first correlated message only. On the first message to be published, set the InitializeConversationId property to True. After the message is published, retrieve the transaction ID from the message. This transaction ID should be used to set the conversation ID (that is, the correlation ID) for all subsequent messages to be published.
/* On the first message to be published */
&MSG.InitializeConversationId = True;
%IntBroker.Publish(&MSG);
&strCorrelationID = &MSG.TransactionId;
/* For all subsequent correlated messages */
&MSG.IBInfo.ConversationID = &strCorrelationID;
%IntBroker.Publish(&MSG);
Then, on the subscribing node, use the FirstCorrelation method to run the OnPreNotify event one time only:
If &MSG.FirstCorrelation() = True Then
/* process the OnPreNotify event logic */
End-If;