Cleaning up MER queues

If MER queues are used to collect copies of messages (for example, so that the messages are available in case of inquiries), those queues need to be cleaned up periodically. For such queues, the Administration Utility provides a queue cleanup function that can be used to dispose of outdated messages. It is not necessary to dispose of messages from MER queues that contain messages that are processed by MER Facility users, for example, messages that are edited or authorized. The cleanup function reports its operation in a separate log file for each queue and OU, for example in the file OU1_Trail.log for cleanup of messages in queue Trail for organizational unit OU1. See Figure 1 for a sample content.

Figure 1. Example of a log file produced by the Administration Utility queue cleanup utility

⋮
-------------------------------------------------------------------------------
MER queue cleanup started: 3/13/20 8:05 AM, User: asc
Cleanup of messages in queue 'Trail'-[M] which are not modified after '2020-02-12 00:00:00.000' UTC

Removing message, ID='83322'
Removing message, ID='83325'
DNQA0010I Summary of cleanup operation:
          Total number of messages in queue .....: 9
          Applicable messages for cleanup .......: 9
             Number of messages locked ..........: 0
             Number of messages to be disposed of: 9
             Number of messages deleted .........: 2
⋮

The Administration Utility queue cleanup utility can also be run in rehearsal mode. When run in this mode, the utility checks for outdated messages without disposing of them. It can be called from shell scripts and returns a status code to indicate problems. All parameters are provided in environment variables or as command-line arguments. You can create a shell script that calls the cleanup utility once for each queue, and execute this script periodically, for example as a UNIX cron job.

The age of a message is determined by its store time in the database. The store time is updated by each action that generates a history entry, including Submit, Accept, Reject, Redirect, Move, Copy, custom actions, and any other routing activity. The store time is not updated when a message is viewed, opened, or closed, or when the lock on the message is broken.

The age of a message determines whether it is to be retained when the MER queue cleanup utility is run. When you start the MER queue cleanup utility, you specify a time period. Messages that are older than this time period are considered to be outdated and, unless the utility is run in rehearsal mode, are disposed of (that is, they are removed from their queues). Outdated messages that are locked by a user of the MER Facility, or that are to be processed by a routing flow, are not disposed of.

The Administration Utility queue cleanup utility updates the message warehouse, unless this is disabled by command-line argument -mwh. The MWH_MSG_STATUS field is set to Disposed for existing records available in the message warehouse. The command never creates new message warehouse records.