See information about the latest product version
Setting timeout values for aggregation
You can use two properties of the aggregation nodes to set timeout values for aggregated message processing.
- The need to receive an aggregated reply message within a specified time. For this situation, you set the Timeout property of the AggregateControl node.
- The need to wait before propagating an unrecognized message to the Unknown terminal. For this situation, you set the Unknown Message Timeout property on the AggregateReply node.
To receive an aggregated reply message within a specified time
- Directly on the AggregateControl node
- Set the Timeout property of the AggregateControl node to specify how long (in seconds) the broker must wait for replies. By default, this property is set to 0 (zero), which means that there is no timeout and the broker waits indefinitely. For more information, see AggregateControl node.
- Using an Aggregation configurable service
- You can also use an Aggregation configurable service to specify the timeout interval. You can create an Aggregation configurable service with the same name as the Aggregate name property of the AggregateControl node, and specify the timeout value in the timeoutSeconds property of the configurable service. Alternatively, you can create an Aggregation configurable service with the same name as the execution group. Values from Aggregation configurable services are taken in the following order:
- If an Aggregation configurable service exists with the same name as the aggregation, which is defined in the Aggregate name property, that configurable service is used.
- If no configurable service exists with the same name as the aggregation, but a configurable service exists with the same name as the execution group, that configurable service is used.
If an Aggregation configurable service exists with the same name as an execution group, it can be used for every aggregation in the execution group. However, if a configurable service exists with the same name as an aggregation in the execution group, it is used for that specific aggregation. In each case, the value of the timeoutSeconds property of the configurable service overrides the Timeout property of the AggregateControl node.
For more information about the Aggregation configurable service, see Configurable services properties.
- Dynamically from an incoming message
You can use the Timeout location property of the AggregateControl node to specify the location of a timeout value in the incoming message. Any timeout value that is specified in this way overrides the values that are specified by the AggregateControl node and the Aggregation configurable service.
For more information, see AggregateControl node.
- If a timeout value is specified in the incoming message (in the location that is specified by the Timeout location property of the AggregateControl node) this value is used.
- If no location is specified by the Timeout location property, or if the location in the message is empty or does not exist, the value that is specified by the timeoutSeconds property of the Aggregation configurable service is used (if one exists).
- If no Aggregation configurable service has been defined, or if the timeoutSeconds property of the configurable service is not set, the value that is set in the Timeout property of the AggregateControl node is used.
By default, timeout polling occurs every 5 seconds. Therefore, if you set the Timeout property to a value that is not a multiple of 5, an extra delay occurs. For example, if you set the Timeout property to 7 seconds, you see a delay of 3 seconds until timeout polling next occurs. You can change the default timeout polling interval by using the environment variable MQSI_AGGR_WAIT_TIMEOUT. Valid values are 1000 - 5000 milliseconds. To change the default polling interval, stop the broker, then restart the broker in an environment where you have set the MQSI_AGGR_WAIT_TIMEOUT environment variable.
If the timeout interval passes without all the replies arriving, the replies that have arrived are turned into an aggregated reply message by the corresponding AggregateReply node, and propagated to its Timeout terminal. You can process this partial response message in the same way as a complete aggregated reply message. If you prefer, you can provide special processing for incomplete aggregated replies.
To wait before propagating an unrecognized message to the Unknown terminal
- The reply message might arrive before the work completed by the AggregateRequest node has been transactionally committed. This situation can be avoided by configuring the Transaction mode property of the input node, as described in Creating the aggregation fan-out flow.
- The reply message might arrive before the control message. This situation can be avoided by leaving the Control terminal of the AggregateControl node unconnected. For more information about the implications of connecting the Control terminal, see Using control messages in aggregation flows.
- Open the fan-in message flow.
- Set the Unknown Message Timeout property
of the AggregateReply node.
When you set this property, a message that cannot be recognized immediately as a valid reply is held persistently in the broker for the number of seconds that you specify for this property.
If the unknown timeout interval expires, and the message is recognized, it is processed. The node also checks to see if this previously unknown message is the last reply that is needed to make an aggregation complete. If it is, the aggregated reply message is constructed and propagated.
If the unknown timeout interval expires and the message is still not recognized, the message is propagated to the Unknown terminal.