Error queue

The error queue is an optional processor-unique local IBM MQ queue. If business event support processes the business event, but an error occurs before the business event dispatch adapter completes processing, the business event is added to the specified error queue.

The error queue provides you with a way to review the business event and determine what caused the error. You can use an error queue to debug issues when testing new events. For example, enter the ZBEVF ERROR command with the COPY parameter specified to copy information from the error queue to a file system file. You can use this file system file to diagnose the problem.

You also can use the error queue to retransmit events in a production environment. When the problem that caused the data to be added to the error queue is fixed, you can add the business event to the dispatch queue so that it can be retransmitted. Enter the ZBEVF ERROR command with the MOVE parameter specified to move business events from the error queue to the dispatch queue.

The error queue and dispatch queue must be defined as separate queues. Enter the ZMQSC DEFINE QL command to define the error queue. For example:

ZMQSC DEFINE QL-'IEVENT.FlightDelay.Error.Queue' NOTRIGGER MAXDEPTH-0

Ensure that you periodically clean up the error queue. By default, the z/TPF system does not automatically remove events from the error queue. Consider writing a monitor to periodically report items on the error queue and to clean up the error queue as required. Alternatively, use the <esErrorExpiry> attribute of the <esErrorQueue> element to set an expiration time for the data in the error queue. You also can enter the ZBEVF ERROR command with the REMOVE parameter specified to manually clean up the error queue.

Business events are added to the error queue in the format defined by the tpf_bev_errorQueueItem structure in the tpf/ibev.h header file. This structure includes all of the data that is required to add the event request to the dispatch queue. Multiple events can use one error queue.

If the error queue is not specified in the business event specification or if the return code from the optional event error program indicates that the business event is not to be added to the error queue, the business event is not added to the error queue and is discarded.

The order of business events that are placed on the error queue is not preserved even if the business event was processed by an ordered dispatch queue.