Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7307971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:29:38+00:00 2026-05-28T23:29:38+00:00

From my application I need to query some Websphere MQ per-queue statistics (last message

  • 0

From my application I need to query some Websphere MQ per-queue statistics (last message get/put time, number of en/dequeued messages, current queue depth, number of connected clients).
I managed to get the queue depth via PCFAgent, but I’m kind of stuck on the rest because the IBM documentation is rather confusing.

Do you know any useful references (or code examples) that might help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T23:29:38+00:00Added an answer on May 28, 2026 at 11:29 pm

    If you installed the WMQ client in the default location then the samples will be at: C:\Program Files (x86)\IBM\WebSphere MQ\tools\pcf\samples.

    On UNIX flavors, they end up under /opt/mqm/samp.

    If you just grabbed the jar files and did not install the client then you won’t have a supported configuration – or the samples, tracing utilities, diagnostic tools, etc., etc. The client install media is available for free download in the SupportPacs page. The different clients currently available are:

    • Version 6.0 is SupportPac MQC6 (V6 is end of life Sept 2012)
    • Version 7.0 is SupportPac MQC7
    • Version 7.1 is SupportPac MQC71

    Make sure that you are looking at the Infocenter for the version of WebSphere MQ Server that you are connecting to. Also note that if you connect to a v7 QMgr and are using a v6 client, then the constants and classes you are using will limit you to the v6 functionality. Preferably, use the latest client since it is always backward compatible with older QMgr versions.

    UPDATE:

    Here are some code snippets to perform the requested functions:

    First you need a queue manager connection (qmgr). Then you can create a PCFMessageAgent:

    // Create PCF Message Agent
    try {
        pcfAgent = new PCFMessageAgent(qmgr);
    } catch (MQException mqe) {
        System.err.println("PCF Message Agent creation ended with reason code "
                           + mqe.reasonCode);
        return mqe.reasonCode;
    }
    

    You can get most of the attributes you need using (except the enq/deq count) the call below. Note that in order to get last msg get\put time you need to turn queue monitoring (MONQ) on.

    // Prepare PCF command to inquire queue status (status type)
    inquireQueueStatus = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);
    inquireQueueStatus.addParameter(CMQC.MQCA_Q_NAME, "name of queue to inquire");
    inquireQueueStatus.addParameter(CMQCFC.MQIACF_Q_STATUS_TYPE, CMQCFC.MQIACF_Q_STATUS);
    inquireQueueStatus.addParameter(CMQCFC.MQIACF_Q_STATUS_ATTRS, new int[] {
                      CMQC.MQCA_Q_NAME, CMQC.MQIA_CURRENT_Q_DEPTH,
                      CMQCFC.MQCACF_LAST_GET_DATE, CMQCFC.MQCACF_LAST_GET_TIME,
                      CMQCFC.MQCACF_LAST_PUT_DATE, CMQCFC.MQCACF_LAST_PUT_TIME,
                      CMQCFC.MQIACF_OLDEST_MSG_AGE, CMQC.MQIA_OPEN_INPUT_COUNT,
                      CMQC.MQIA_OPEN_OUTPUT_COUNT, CMQCFC.MQIACF_UNCOMMITTED_MSGS });
    

    You can retrieve the parms using:

    pcfResp = pcfAgent.send(inquireQueueStatus);
    

    The for each individual parms you can use the getXXXXXParameterValue method (XXXXXX is the type of data).

    For the Enq/Deq counts, you need to reset the queue statistics:

    // Prepare PCF command to reset queue statistics
    queueResetStats = new PCFMessage(CMQCFC.MQCMD_RESET_Q_STATS);
    queueResetStats.addParameter(CMQC.MQCA_Q_NAME, queueName);
    
    pcfResp3 = pcfAgent.send(queueResetStats);
    
    queueMsgDeqCount = pcfResp3[0].getIntParameterValue(CMQC.MQIA_MSG_DEQ_COUNT);
    queueMsgEnqCount = pcfResp3[0].getIntParameterValue(CMQC.MQIA_MSG_ENQ_COUNT);
    

    Let me know if you have more questions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to view some of PVRTC-compressed textures from iPhone application (*.pvr) on OS
I've been working in a time attendance application and need some enlightment. This is
From a WindowsPhone7 application I need to query a web service by sending a
In the java web application need to select the file from server and print
From a logical point of view an application may need dozens or hundreds of
I need to run an external application from within my Java code. I can
I need loging all HTTP request (from any application). I have Delphi 7.0. Anybody
I need to server parts of my application from different domains. To be precise
I need to save an camera image from my application to the desktop so
In certain areas in my application I need data from several tables in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.