MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  amqsput and amqsget issue

    Posted Mon July 17, 2023 09:28 AM
    bash-4.4$ strmqm test3
    There are 80 days left in the trial period for this copy of IBM MQ.
    IBM MQ queue manager running.
    bash-4.4$ runmqsc test3
    5724-H72 (C) Copyright IBM Corp. 1994, 2020.
    Starting MQSC for queue manager test3.
     
     
    DIS Q(test)
         1 : DIS Q(test)
    AMQ8409I: Display Queue details.
       QUEUE(TEST)                             TYPE(QLOCAL)
       ACCTQ(QMGR)                             ALTDATE(2023-07-17)
       ALTTIME(10.48.55)                       BOQNAME( )
       BOTHRESH(0)                             CLUSNL( )
       CLUSTER( )                              CLCHNAME( )
       CLWLPRTY(0)                             CLWLRANK(0)
     
     
    [root@mq bin]# ./amqsput test test3
    Sample AMQSPUT0 start
    target queue is test
    MQOPEN ended with reason code 2085
    unable to open queue for output
    Sample AMQSPUT0 end
     
    In mq explorer putting and getting message for local queue is working but in command line its not working..
    I have installed mq on linux vm ..
    I am new to mq, kindly expecting related info to this issue ..


    ------------------------------
    thirumoorthy viswanathan
    ------------------------------


  • 2.  RE: amqsput and amqsget issue

    Posted Mon July 17, 2023 09:59 AM

    runmqsc is upper-casing the queue name test to TEST, but AMQSPUT0 is not. You have a queue defined called 'TEST', but probably do not have a queue defined called 'test'--perhaps you also defined the queue with runmqsc.

    You can upper-case the queue name when you call amqsput, or define the queue in mixed-case when using runmqsc, by enclosing the name in single quotes.

    Thanks.



    ------------------------------
    Rich Harran
    ------------------------------



  • 3.  RE: amqsput and amqsget issue

    Posted Tue July 18, 2023 11:18 AM
    Edited by om prakash Tue July 18, 2023 12:10 PM

    Adding to what Rich has shared, the command would be.

    ./amqsput 'TEST' 'test3'

    *corrected the syntax.

    ------------------------------
    om prakash
    ------------------------------



  • 4.  RE: amqsput and amqsget issue

    Posted Tue July 18, 2023 11:26 AM

    No, not exactly. amqsput is already using lower-case test as the queue name. The queue is actually defined as TEST, which may or may not be what you want, and the queue manager is test3. The following might work:

    ./amqsput TEST test3



    ------------------------------
    Rich Harran
    ------------------------------



  • 5.  RE: amqsput and amqsget issue

    Posted Sat November 18, 2023 07:22 AM

    You need to run MQ commands as "mqm" user – not root.

     

    Also on Linux you need to run the set environment command  (setmqenv) located in /opt/mqm/bin.

    https://www.ibm.com/docs/en/ibm-mq/9.1?topic=reference-setmqenv-set-mq-environment

     

     

     

    Susan Barker

    Sr. ITX, MQ, ACE Architect II

    IBM Champion since 2018

    Mobile:  224-275-0840

    Home cell:  276-880-4327

    Home cell:  423-656-1612

    CDW email: susbark@cdw.com

    Incidents:  eiaadmin-esb@cdw-1.pagerduty.com

     






  • 6.  RE: amqsput and amqsget issue

    Posted Mon November 20, 2023 07:39 AM

    Hello!
    One of the Best Practices with MQ is to use names for the queue manager and for the queue that are in UPPERCASE.
    The names are Case Sensitive. The following names are NOT the same, they refer to different objects:
    queue: test 
    queue: TEST
    .
    If you use lower case or mixed case, then you must always refer them with single quotes: 'test'
    ... but this is cumbersome!
    .
    You can use the MQ utility "mqrc" to see the name of the reason code 2085:

    C:\> mqrc 2085
          2085  0x00000825  MQRC_UNKNOWN_OBJECT_NAME

    .
    When you use the DISPLAY command, notice the name: TEST

    AMQ8409I: Display Queue details.

       QUEUE(TEST)                             
    .
    Thus, when you use the name in lower case:
    amqsget test
    .
    ... you get reason code 2085, because queue "test" does not exist.
    .
    You can try the following:
    amqsget TEST test3
    .
    I suspect that in MQ Explorer you are seeing "TEST" and not "test".

    I hope that this is helpful.
    Thank you!
    Angel Rivera
    IBM MQ Support


    ------------------------------
    Angel Rivera
    IBM MQ Support
    Research Triangle Park NC
    ------------------------------