MQ

 View Only
  • 1.  Tracking Down Queues Based Upon Channel Name

    Posted Wed September 22, 2021 11:45 AM
    Hi all:

    Context: There are cases in which, prior to starting a SDR channel, I would like to know which queues are serviced by that channel, and if there is any depth on the queues. Ideally, I would like to script this (to make the check quick), so PCF commands are probably the way to go if the capability is there.

    I've tried capturing the mca user from the channel, then locating all queues for which there is an authrec for that user, but it turns out, we have many channels that just rely on the default mqm user, leaving the mcauser field empty, so that's just a partial solution.

    Does anyone have any tips on what MQ has available to solve this problem?

    TIA,
    Rich

    ------------------------------
    Richard Lohman
    ------------------------------


  • 2.  RE: Tracking Down Queues Based Upon Channel Name

    IBM Champion
    Posted Wed September 22, 2021 06:35 PM
    Do your applications make use of QREMOTE definitions or do they simply do a fully qualified put (queue @ qmgr)? If the former, it would be a fairly simple job to enumerate all the QREMOTE definitions that go through the XMITQ that your SDR channel reads from. You have no way to discover the fully qualified puts ahead of time though.​

    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 3.  RE: Tracking Down Queues Based Upon Channel Name

    IBM Champion
    Posted Wed September 22, 2021 09:18 PM
    Sender channels service only 1 queue, the transmission queue that feeds the sender channel.

    I'm guessing you mean the Receiver channel on the destination side. In that case, is whatever queues the effective MCAUSER has access to. And in cases where the RCVR channel is allowed to run as mqm with no other restrictions, that is any and every queue on the destination queue manager.

    What problem are you trying to solve?

    ------------------------------
    Peter Potkay
    ------------------------------



  • 4.  RE: Tracking Down Queues Based Upon Channel Name

    Posted Thu September 23, 2021 12:39 PM
    Thanks, Peter:
    I have a solution (another reply), but in this case, the problem space is that we have multiple partners that connect into the queue managers in question, and the queue managers are replicated in our DR location. Some partners have their own MQ installations (not usually a problem), but others connect directly via their applications using the a client connection. For the latter group, there is a sequence of events that can happen during failover for DR testing on weekends in which when SDR channels are started, client connections see the channel, and start trying to pull messages off the queues. If there are test messages in the queues (leftovers from prior testing), these will be consumed by the partner. We are shoring up those processes to ensure a clean environment, but this request is for a secondary check right before starting the channel for any queues which are serviced by the channel in question, and may have depth .

    ------------------------------
    Richard Lohman
    ------------------------------



  • 5.  RE: Tracking Down Queues Based Upon Channel Name

    Posted Thu September 23, 2021 12:25 PM
    Hi Richard
    https://www.ibm.com/docs/en/ibm-mq/9.0?topic=reference-example-mq-configuration-all-platforms
    The transmission queues might contain the depth you are looking for.

    ------------------------------
    Matthias Jungbauer
    ------------------------------



  • 6.  RE: Tracking Down Queues Based Upon Channel Name

    Posted Thu September 23, 2021 12:43 PM
    Edited by Richard Lohman Thu September 23, 2021 12:44 PM
    Hi, Matthias:

    This helped get me to the solution. I was looking at the inbound side, rather than the outbound side. Here's what I came up with:

    knownChannel=<any SDR channel>
    xmitq=$(su - mqm "echo \"DIS CHANNEL($knownChannel) XMITQ\" | runmqsc <QMGRNAME> | grep XMITQ | awk -F \"[()]\" '{print \$2}' | grep -v $knownChannel")
    msgCount=$(/path/to/qdepths | grep $xmitq | awk '{print $3}')

    Thanks, all for the input.
    RJL

    ------------------------------
    Richard Lohman
    ------------------------------



  • 7.  RE: Tracking Down Queues Based Upon Channel Name

    IBM Champion
    Posted Fri September 24, 2021 03:01 AM

    Just trying to understand your final solution (since I clearly didn't understand your original question!). Are you just trying to discover the current depth of the transmission queue that your sender channel will read from?

    Thanks,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 8.  RE: Tracking Down Queues Based Upon Channel Name

    Posted Fri September 24, 2021 09:57 AM
    Edited by Richard Lohman Fri September 24, 2021 09:57 AM
    Hi, Morag:

    Precisely. (Apologies, I've been away from MQ for a while, and just now getting back into it, so my use of terms may be perfect). By starting with the channel name, and looking back to see what queues are accessible via that channel, I can tell before I start the channel whether there are messages on the queue which may get consumed.

    Best regards,
    Rich

    ------------------------------
    Richard Lohman
    ------------------------------



  • 9.  RE: Tracking Down Queues Based Upon Channel Name

    IBM Champion
    Posted Tue September 28, 2021 04:37 PM
    Can you just set both triggering and DISCINT so your channel automatically starts when there are messages to move and automatically goes to sleep after x seconds of no messages to move?

    ------------------------------
    Peter Potkay
    ------------------------------