Command to check queue depth in mq

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Is it feasible to check queue depth MQ using any scripts?

The plan is to look at non-Java solutions. Hence checking for any alternate options or better practices. The perl mqseries is very complete. Below is some sample code. Part of the credit for the sample probably goes to someone else, but it has been floating around my drive for years.

The code connects to the queue manager specified by the command line, if not supplied, it will connect to the default queue manager.

It then inquires about the queue name passed in, specifically, the current depth of that queue. This is displayed to the user. This code can easily be modified to display other queue properties. Here is the subset sample code:. If you are logged in using MQM user on linux and want to have a quick check on queues with messages in them.

Some need a thin glue layer, some need nothing at all. Learn more. Can we check the queue depth using a scripting language? Ask Question. Asked 7 years, 7 months ago. Active 3 years, 3 months ago. Viewed 5k times. Active Oldest Votes.

command to check queue depth in mq

Roger Roger 5, 8 8 silver badges 15 15 bronze badges.You cannot use a generic filter-value for parameters with numeric values or with one of a set of values. The value can be a generic name. If you do not enter a value to qualify this parameter, it is treated as a requested parameter, and cluster name information is returned about all the queues displayed.

You can specify a queue manager name, other than the queue manager on which the command was entered, only if you are using a queue-sharing group environment and if the command server is enabled.

If you do not enter a value to qualify this parameter, it is treated as a requested parameter, and storage class information is returned about all the queues displayed. Specify one or more parameters that define the data to be displayed. The parameters can be specified in any order, but do not specify the same parameter more than once.

Most parameters are relevant only for queues of a particular type or types. Parameters that are not relevant for a particular type of queue cause no output, nor is an error raised.

The following table shows the parameters that are relevant for each type of queue. There is a brief description of each parameter after the table, but for more information, see the DEFINE command for each queue type.

Cross-tabulation of queue parameters and queue types. If the parameter applies to the queue type, the cell contains a check mark. The queue was created with a DEFINE command, either by an operator or by a suitably authorized application sending a command message to the service queue. Either the queue was created by an application issuing MQOPEN with the name of a model queue specified in the object descriptor MQODor if this is a model queue this determines the type of dynamic queue that can be created from it.

With a disposition of SHARED, only the handles for the queue manager sending back the information are returned, not the information for the whole group. Usage notes You can use the following commands or their synonyms as an alternative way to display these attributes.

If you enter the commands this way, do not use the TYPE parameter. The command might not show every clustered queue in the cluster when issued on a partial repository, because the partial repository only knows about a queue once it has tried to use it. This can be a specific queue name or a generic queue name.

By using a generic queue name, you can display either: All queue definitions One or more queues that match the specified name queue-name The local name of the queue definition to be displayed see Rules for naming IBM WebSphere MQ objects. WHERE Specify a filter condition to display only those queues that satisfy the selection criterion of the filter condition. The filter condition is in three parts: filter-keywordoperatorand filter-value : filter-keyword Almost any parameter that can be used to display attributes for this DISPLAY command.

Queues of a type for which the filter keyword is not a valid attribute are not displayed. Depending on the filter-keyword, this can be: An explicit value, that is a valid value for the attribute being tested.

A generic value. If the operator is LK, all items where the attribute value begins with the string ABC in the example are listed. If the operator is NL, all items where the attribute value does not begin with the string are listed. Only a single trailing wildcard character asterisk is permitted. ALL Specify this to display all the attributes.

If this parameter is specified, any attributes that are also requested specifically have no effect; all attributes are still displayed. CFSTRUCT generic-name This parameter is optional and limits the information displayed to those queues where the value of the coupling facility structure is specified in brackets. CLUSINFO This requests that, in addition to information about attributes of queues defined on this queue manager, information about these and other queues in the cluster that match the selection criteria is displayed.

In this case, there might be multiple queues with the same name displayed. The cluster information is obtained from the repository on this queue manager.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I have a requirement to write a shell script to check queue depth of few queues in remote Queue manager.

Version of remote queue manager IBM websphere Mq v8. Can anyone advise on this? But if you must, here's one I used back in the early 's that I called chkQdepth. You can run the script manually but it is far better to setup it so that a scheduler runs it, say every 5 minutes. Learn more. How to check queue depth of a remote queue manager using script?

Subscribe to RSS

Ask Question. Asked 7 months ago. Active 7 months ago. Viewed times. Johnwick Johnwick 1. Active Oldest Votes. You can do the following: 1 Create an mqsc file, say curdepth. Shashi Shashi Q1 50 roger acme. Q1 has too many messages. Q1 has too many messages in it. Roger Roger 5, 8 8 silver badges 15 15 bronze badges. Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. The Overflow How many jobs can be done at home? Featured on Meta. Community and Moderator guidelines for escalating issues via new response…. Feedback on Q2 Community Roadmap. Technical site integration observational experiment live on Stack Overflow. Triage needs to be fixed urgently, and users need to be notified upon…. Dark Mode Beta - help us root out low-contrast and un-converted bits.

Visit chat. Related 0.For each attribute, there is a brief description of when you might need to configure the attribute. The following table lists the attributes you can set on the General page of the Queue properties dialog. The following table lists the attributes you can set on the Extended page of the Queue properties dialog. None : No index is maintained.

Use this when retrieving messages sequentially. This is the default. Correl ID : An index of correlation identifiers is maintained. Message token : An index of message tokens is maintained. To configure the queue so that non-persistent messages are not automatically read ahead by the client, select No.

This is the default value. Messages are not automatically read ahead by the client ahead of an application requesting them.

IBM MQ V8 0 Tutorials - Installation in Windows OS - Video 1

Messages are only read ahead if requested by the client. A maximum of one non-persistent message might be lost if the client ends abnormally. To disable read ahead at the queue level, select Disabled.

Messages are not read ahead by the client ahead of an application requesting them, regardless of whether read ahead is requested by the client application. To contain all the properties of the message, except those contained in the message descriptor or extensionselect All. The All value means that all properties of the message are included with the message when it is sent to the remote queue manager. The properties, except those properties in the message descriptor or extensionare placed in one or more MQRFH2 headers in the message data.

Compatibility means that if the message contains a property with a prefix of mcd. Otherwise all properties of the message, except those contained in the message descriptor or extensionare discarded and are no longer accessible to the application.

Properties of the message are not accessible via the message handle. To discard all the properties of a message, except those contained in the message descriptor or extensionselect None. This value prevents applications that do not support message properties from being affected by the inclusion of any property in a message.

If message properties have been provided and are not contained in the original MQRFH2 headers, they are returned in a message handle or otherwise discarded. The queue manager parses the value, but if the string cannot be parsed according to these rules, or if it contains attributes or values that are not recognized, the queue manager ignores the errors.

You can change the default for the queue manager, so that all cluster-sender channels transfer messages from separate transmission queues. The queue manager attribute is Default cluster transmission queue. The queue manager creates separate transmission queues automatically, when they are required.

command to check queue depth in mq

The queue manager does not set the Cluster channel name parameter. Set the Cluster channel names parameter to the name of a single cluster-sender channel, or to a generic name. A generic name associates multiple cluster-sender channels with this transmission queue.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.

command to check queue depth in mq

I'm probably missing something here turns out I wasas it's been about a year since I dealt with MQ at all and even then it was only peripherally, but wouldn't this command from the doc you linked give you the queue depth for a particular queue? Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. Asked 10 years, 7 months ago. Active 2 years, 5 months ago. Viewed 11k times. JoshMc 7 7 bronze badges.

Active Oldest Votes. Deleted old incorrect answer Per Andrew's correct answer, you need to pipe the command to runmqsc. Brian Brian 2 2 gold badges 12 12 silver badges 19 19 bronze badges. Turns out I needed to use amqspsd to resolve the name of the queue. After resolving I was able to use runmqsc. Which version of MQ does this work on? I keep getting invalid syntax, then the list of options. It doesn't work on any version of MQ.

You either type it on a command line then enter the commands once inside its shell, or else pipe the commands to it. See Andrew's correct but oddly not accepted solution. Rob Feb 22 '17 at Sign up or log in Sign up using Google. Sign up using Facebook.Use the dspmq command to display names and details of the queue managers on a system.

The parameter -o status is equivalent to -s. Purpose Use the dspmq command to display names and details of the queue managers on a system. Optional parameters -a Displays information about the active queue managers only. A queue manager is active if it is associated with the installation from which the dspmq command was issued and one or more of the following statements are true: The queue manager is running A listener for the queue manager is running A process is connected to the queue manager.

Table 1. Standby values Value Description Permitted The queue manager is running and is permitting standby instances. Not permitted The queue manager is running and is not permitting standby instances.

Not applicable The queue manager is not running. You can start the queue manager and this instance becomes active if it starts successfully.

Table 2. Instance values Value Description Active The instance is the active instance. Standby The instance is a standby instance. For example, this list typically includes: Queue manager processes Applications, including those that are inhibiting shutdown Listeners. Queue Manager States The following is a list of the different states a queue manager can be in: Starting Running Running as standby Running elsewhere Quiescing Ending immediately Ending pre-emptively Ended normally Ended immediately Ended unexpectedly Ended pre-emptively Status not available.

Return codes Return code Description 0 Command completed normally 36 Invalid arguments supplied 58 Inconsistent use of installations detected 71 Unexpected error 72 Queue manager name error. Examples The following command displays queue managers on this server: dspmq -o all The following command displays standby information for queue managers on this server that have ended immediately: dspmq -o standby The following command displays standby information and instance information for queue managers on this server: dspmq -o standby -x.

Reference Feedback Last updated: Thursday, April 2, The queue manager is running and is permitting standby instances. The queue manager is running and is not permitting standby instances. The queue manager is not running. The instance is the active instance. The instance is a standby instance. Command completed normally. Invalid arguments supplied. Inconsistent use of installations detected.The state of asynchronous consumers, ASTATE, reflects that of the server-connection proxy on behalf of the client application; it does not reflect the client application state.

You cannot use a generic filter-value for parameters with numeric values or with one of a set of values. This value is the default if you do not specify a generic name, and do not request any specific parameters. You can specify a queue manager name, other than the queue manager on which the command was entered, only if you are using a queue-sharing group environment and if the command server is enabled.

DISPLAY QUEUE

For shared queues, the number returned applies only to the queue manager generating the reply. The number is not the total for all the queue managers in the queue-sharing group. For shared queues, if the CF structure used by the queue is unavailable or has failed, the status information might be unreliable.

The interval is measured from the time that the message is placed on the queue until it is destructively retrieved by an application and, therefore, includes any interval caused by a delay in committing by the putting application. These values depend on the configuration and behavior of your system, as well as the levels of activity within it, and serve as an indicator that your system is performing normally.

A significant variation in these values might indicate a problem with your system. For shared queues, the value returned applies only to the queue manager generating the reply. The value does not apply to all the queue managers in the queue-sharing group. Application name represents the name of the process or job that has connected to the queue manager.

In the instance that this process or job is connected via a channel, the application name represents the remote process or job rather than the local channel process or job name. The call-back function is initiated again when asynchronous message consumption is resumed by the system, when the temporary condition has been resolved. You must specify the name of the queue for which you want to display status information. This name can either be a specific queue name or a generic queue name.

By using a generic queue name you can display either: Status information for all queues, or Status information for one or more queues that match the specified name and other selection criteria. You must also specify whether you want status information about: Queues Handles that are accessing the queues. If you specify the name of one of these types of queue, no data is returned.


comments

Leave a Reply

Your email address will not be published. Required fields are marked *