You are seeing AMQ7315 or AMQ7316 errors after deleting messages from the WebSphere MQ SYSTEM.ADMIN.ACCOUNTING.QUEUE or SYSTEM.ADMIN.STATISTICS.QUEUE.
AMQ7315: Failed to put message to accounting queue. Reason(2053)
EXPLANATION: The attempt to put a message containing accounting data to the queue SYSTEM.ADMIN.ACCOUNTING.QUEUE failed with reason code 2053. The message data has been discarded. This error message will be written only once for attempts to put a message to the queue as part of the same operation which fail for the same reason.
ACTION: Ensure that the queue SYSTEM.ADMIN.ACCOUNTING.QUEUE is available and operational.
AMQ7316: Failed to put message to statistics queue. Reason(2053)
EXPLANATION: The attempt to put a message containing statistics data to the queue SYSTEM.ADMIN.STATISTICS.QUEUE failed with reason code 2053. The message data has been discarded. This error message will be written only once for attempts to put a message to the queue as part of the same operation which fail for the same reason.
ACTION: Ensure that the queue SYSTEM.ADMIN.STATISTICS.QUEUE is available and operational.
You can use the "mqrc" utility to find the meaning of the Reason Code 2053:
% mqrc 2053
2053 0x00000805 MQRC_Q_FULL
The most likely cause for this problem is that the queue is full of messages and cannot receive another message.
Resolving the problem
In general, you should not delete messages from any of the WebSphere MQ SYSTEM.* queues.
a) The sample monitoring utility "amqsmon" can be used to get the messages from the queues and display the information contained in the messages. The default mode is to do a destructive "get" of these messages and thus, this would clear up the messages from those queues.
b) Restart the queue manager: the messages in the SYSTEM.ADMIN.* queues are non-persistent, which means, that they do not survive a restart of the queue manager.
You could use runmqsc to CLEAR the messages from these 2 queues and if you are very careful, you will not damage the configuration.
CAVEAT: You need to be very careful because if you make a typo and accidentally delete the contents of other SYSTEM queues, you may corrupt the queue manager and then you may have to delete the entire queue manager and recreate it.
In case the CLEAR command fails (such as reporting that the queue has been opened by another process), then you could use the following sample program, which will get every message from the queue (in a destructive get mode):
amqsget SYSTEM.ADMIN.STATISTICS.QUEUE QueueManager
The SYSTEM.ADMIN.ACCOUNTING.QUEUE and SYSTEM.ADMIN.STATISTICS.QUEUE are used by the monitoring feature introduced in WebSphere MQ V6. If monitoring is enabled, then accounting and statistics messages are placed on these queues. These messages are generated at the end of the queue manager accounting and statistics interval, and when the reset queue manager statistics command is issued via runmqsc:
RESET QMGR TYPE(STATISTICS)
If you notice that there are messages on these queues, this indicates that the queue manager accounting, or the statistics monitoring feature of MQ has been enabled.
You can disable the queue manager accounting or the statistics monitoring features using runmqsc commands. Example:
ALTER QMGR ACCTQ(OFF) STATQ(OFF)
The queue manager may continue creating statistics records (2 scenarios to consider)
Scenario 1: After you turn off the statistics for the queue manager, you may notice that you still see new statistics messages being added to the system queue. The reason is that the change of the STATQ attribute does not affect those queues which are already open (very likely SYSTEM.* queues), and thus, these queues may be generating new statistics messages. You will need to restart the queue manager for these queues to stop generating new statistics.
Let's suppose that you ensure that STATQ is OFF at the queue manager level and then you restart the queue manager to avoid the situation mentioned in Scenario 1 (above):
display qmgr statq
AMQ8408: Display Queue Manager details.
But you keep seeing new messages being added to the SYSTEM.ADMIN.STATISTICS.QUEUE.
The most likely reason is that an explicit and manual alteration was done to at least one of the queues for the attribute STATQ.
The default when a queue is created is STATQ equals QMGR, which means that the behavior of the statistics gathering is based on the overall setting of the queue manager.
The following is an example of the default STATQ:
display ql(Q1) statq
AMQ8409: Display Queue details.
Thus, if the queue manager is NOT collecting statistics, then the queues that have the default attribute of STATQ(QMGR) will NOT collect statistics.
But if the overall switch of STATQ is turned on at the queue manager level, then all the queues that have STATQ(QMGR) will collect statistics.
However, it is possible to override this general behavior.
Let's suppose that you are interested in the statistics for ONLY one or a subset of queues, then you can keep the overall setting at the queue manager STATQ being OFF, but for the selected few queues, you can change it to:
ALTER QL(Q1) STATQ(ON)
Then the statistics will be gathered ONLY for this queue (subset of queues).
You can use the following runmqsc command to display those queues that have STATQ equal ON:
display ql(*) where(STATQ EQ ON)
AMQ8409: Display Queue details.
Then you can decide if you want to keep getting the statistics or stop getting them: you will need to use the ALTER command for STATQ(QMGR) for the queues listed in the output of the above DISPLAY command.
- Beginners Guide - MQ Statistics for Distributed platforms
This document is an introduction to simple monitoring and statistics gathering for MQ on distributed platforms.
- WebSphere MQ: Getting started with Statistics and Accounting
This WebSphere Support Technical Exchange is designed to provide an introduction to Statistics and Accounting features in WebSphere MQ v6.0 on distributed platforms only. It will discuss parameters for enabling and disabling statistics / accounting, utilities for reviewing the data and examples of this data.
- Gathering and Displaying Statistics in WebSphere MQ V7
This WebSphere Support Technical Exchange is designed to present how to gather and display statistics in WebSphere MQ V7, by using the sample amqsmon and the SupportPac MS0P 'WebSphere MQ Explorer - Configuration and Display Extension Plug-ins'.
- SupportPac MS0P: WebSphere MQ Explorer - Configuration and Display Extension Plug-ins
This is a set of plug-ins for the WebSphere MQ Explorer, extending capabilities for queue manager configuration, and displaying additional information about them.
WebSphere MQ WMQ