Topic
  • 4 replies
  • Latest Post - ‏2012-12-14T12:58:06Z by SystemAdmin
SystemAdmin
SystemAdmin
8523 Posts

Pinned topic ma01: how to get generated MsgId?

‏2012-11-30T22:16:39Z |
Hi,
Is it possible to get generated new MsgId when put message with MA01 (q utility)?
I would like to incorporate MA01 in automated testing:
1. Put message to inbound queue Q1;
2. Check if message arrives to target queue Q2 (after processing in flow);
Updated on 2012-12-14T12:58:06Z at 2012-12-14T12:58:06Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: ma01: how to get generated MsgId?

    ‏2012-12-03T11:25:20Z  
    If you don't provide q with a specific message ID to use, then the queue manager will generate unique message IDs for you. I suspect this therefore means you are already getting new MsgIDs generated for you.

    Perhaps I have misunderstood your question? Please ask again with more detail if this is the case.

    Cheers
    Morag
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: ma01: how to get generated MsgId?

    ‏2012-12-04T22:55:54Z  
    If you don't provide q with a specific message ID to use, then the queue manager will generate unique message IDs for you. I suspect this therefore means you are already getting new MsgIDs generated for you.

    Perhaps I have misunderstood your question? Please ask again with more detail if this is the case.

    Cheers
    Morag
    Hi Morag,
    thanks for reply.
    What I'd like to be able to do is:
    1. PUT message to queue Q1 using q program (not providing MsgId);
    2. Get MsgId generated by qmgr;
    3. GET message from queue Q2 by MsgId;

    I know that this could be easily done using MQ Java libraries or generating (hopefully) unique MsgId, but was wondering, maybe q program has some "verbose" mode or other options to print generated MsgId.
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: ma01: how to get generated MsgId?

    ‏2012-12-05T10:40:25Z  
    Hi Morag,
    thanks for reply.
    What I'd like to be able to do is:
    1. PUT message to queue Q1 using q program (not providing MsgId);
    2. Get MsgId generated by qmgr;
    3. GET message from queue Q2 by MsgId;

    I know that this could be easily done using MQ Java libraries or generating (hopefully) unique MsgId, but was wondering, maybe q program has some "verbose" mode or other options to print generated MsgId.
    To display the MessageId using the q program do this:-
    
    q -m qmgr-name -i q-name -dd
    


    -dd displays the MQMD after the MQGET, and thus shows you the Message Id. Here is an example:-
    
    MQMD after MQGET Message Descriptor (MQMD) Report       :00000000 Message Type :8 (Datagram) Format       :
    'MQSTR   ' Priority     :0 Persistence  :0 (Not Persistent) Message Id   :414D51204E54314D4148202020202020FC47B75020003502 
    'AMQ NT1MAH      .G.P .5.' ReplyToQ     :
    '                                                ' ReplyToQMgr  :
    'NT1MAH                                          ' ============================================================================ Hello World
    


    Hope that helps
    Cheers
    Morag
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: ma01: how to get generated MsgId?

    ‏2012-12-14T12:58:06Z  
    To display the MessageId using the q program do this:-
    <pre class="jive-pre"> q -m qmgr-name -i q-name -dd </pre>

    -dd displays the MQMD after the MQGET, and thus shows you the Message Id. Here is an example:-
    <pre class="jive-pre"> MQMD after MQGET Message Descriptor (MQMD) Report :00000000 Message Type :8 (Datagram) Format : 'MQSTR ' Priority :0 Persistence :0 (Not Persistent) Message Id :414D51204E54314D4148202020202020FC47B75020003502 'AMQ NT1MAH .G.P .5.' ReplyToQ : ' ' ReplyToQMgr : 'NT1MAH ' ============================================================================ Hello World </pre>

    Hope that helps
    Cheers
    Morag
    Many thanks Morag, that worked perfectly!!!