SyncRequest method: IntBroker class
Syntax
SyncRequest([&MsgArray, &NodeNames])
Description
Use the SyncRequest method to send multiple messages at the same time. You should only use this message with synchronous messages. You can also use this method to send a single synchronous message at a time, or you can use the SyncRequest Message class method.
If you want to publish messages asynchronously, use the Publish method.
Note:
This method supports nonrowset-based messages only if the SetXmlDoc method is used to populate the message prior to using the SyncRequest method.
You must set the thread pool size of the application server on the receiving system to a value greater than 1 (the default) in order to process more than one message at a time.
How many threads you specify determines how many messages are worked on simultaneously. For example, if you have 10 messages in &MsgArray, and your thread pool size is 5, then only 5 messages are processed at a time.
The maximum number you can specify for your thread pool size is 10.
Parameters
| Parameter | Description |
|---|---|
|
&MsgArray |
Specify an already instantiated array of messages that contains the messages you want to publish. |
|
&NodeNames |
Specify an already instantiated array of string containing the names of the nodes that you want to publish to. The first message in the array of messages is published to the first node, the second message is published to the second node, and so on. |
Returns
An array of messages. These are the corresponding messages returned for the published messages. The first message in the returned array corresponds to the first message in the published array, the second message with the second, and so on.
Example
The following is an example of how creating and receiving a series of messages:
Local Rowset &FLIGHTPLAN, &FLIGHTPLAN_RETURN;
Local Message &MSG;
Local File &BI_FILE;
Declare Function out_BI_results PeopleCode QE_FLIGHTDATA.QE_ACNUMBER FieldFormula;
Local array of Message &messages;
Local array of Message &return_mesages;
&messages = CreateArrayRept(&MSG, 0);
&return_mesages = CreateArrayRept(&MSG, 0);
&FLIGHT_PROFILE = GetLevel0();
&messages [1] = CreateMessage(OPERATION.QE_FLIGHTPLAN_SYNC);
&messages [1].CopyRowset(&FLIGHT_PROFILE);
&messages [2] = CreateMessage(OPERATION.QE_FLIGHTPLAN_SYNC);
&messages [2].CopyRowsetDelta(&FLIGHT_PROFILE);
&return_mesages = %IntBroker.SyncRequest(&messages);
&FLIGHTPLAN_RETURN = &return_mesages [1].GetRowset();
&temp = &return_mesages [1].GenXMLString();
out_BI_results(&temp);
&FLIGHTPLAN_RETURN = &return_mesages [2].GetRowset();
&temp = &return_mesages [2].GenXMLString();
out_BI_results(&temp);
Related Topics