2033 MQRC_NO_MSG_AVAILABLE - VB - Websphere

This is a discussion on 2033 MQRC_NO_MSG_AVAILABLE - VB - Websphere ; disable Hconn Does anyone have a suggestion? Thanks a lot...

+ Reply to Thread
Results 1 to 10 of 10

Thread: 2033 MQRC_NO_MSG_AVAILABLE - VB

  1. 2033 MQRC_NO_MSG_AVAILABLE - VB

    disable Hconn


    Does anyone have a suggestion? Thanks a lot

  2. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    sophie.vanroy@generali.be wrote:
    > disable Hconn
    >
    >
    > Does anyone have a suggestion? Thanks a lot

    Did understand what the problem here. 2033 means there are no messages
    available in the destination (queue or topic) you have opened.

    HTH

  3. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    Its the responsibility of the program to set the CorrelId (24 bytes of binary info), otherwise it will be null. I can't see where you set it before the MQPUT.

  4. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    Hi Glenns Screen,

    and thanks for your reply.

    I defined the correl ID as MQBYTE24 indeed without set any value.
    So I tried to get the message with the MsgID, but it doesn't work either (tried also to copy the msgid in the correlid, but no luck):

    Dim md As MQMD
    Dim pmo As MQPMO
    Dim gmo As MQGMO

    ...
    md.Report = MQRO_PASS_MSG_ID 'copy the MsgID in the report
    md.CorrelId = MQCI_NONE 'no correl ID
    pmo.Options = MQPMO_NEW_MSG_ID 'affects a new msgID in MQPUT
    gmo.MatchOptions = MQMO_MATCH_MSG_ID 'matches with the put msg

    MQGET gHcon, gHobj, md, gmo, GetBuflen, GetBuffer, messlen, CompCode, Reason

    Can you help me? Thanks a lot

  5. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    MQGET gHcon, gHobj, md, gmo, GetBuflen, GetBuffer, messlen, CompCode, Reason

    It doesn't make sense to set pmo before MQGET. It should only be set before MQPUT.

    Put in some debugging to display the MsgId and CorrelId immediately after the MQPUT, and then immediately before the MQGET. This will confirm what you are trying to match on. Also, look at the message on the queue using MQ Explorer, amqsbcg or some other utility.

  6. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    Hi Glenns,

    I made some summarizes and didn't put all the code...
    I put some debugging after the PUT and saw that the msgID is not copied into correlID despite the parameters
    MQRO_COPY_MSG_ID_TO_CORREL_ID + MQRO_PASS_CORREL_ID. And then I try to Get a message from my Reply queue with an empty correlid...

    Am I wrong by thinking that the parameters Copy/pass msgID (or correlId) for the reply must be specified in the message descriptor .report?

    I can now Get a message from my Reply queue but only without specific MatchOptions (= MQMO_NONE) and not a particular message.

    Here's the code (full this time...)

    Dim CompCode As Long 'completion Code
    Dim Reason As Long 'reason code qualifying compcode
    Dim O_options As Long ' MQOPEN options
    Dim od As MQOD ' Object descriptor
    Dim md As MQMD ' Message descriptor
    Dim pmo As MQPMO ' MQPUT message options
    Dim buflen As Long ' Length of message to be put
    Dim gmo As MQGMO 'get message options
    Dim GetBuflen As Long 'length of get buffer
    Dim GetBuffer As String * CCHBUFFER 'got message
    Dim messlen As Long 'length of returned message

    MQ_SETDEFAULTS

    'Open a connection
    'Object Description for MQCONN
    MQOD_DEFAULTS od
    od.ObjectQMgrName = ""
    od.ObjectName = MyPostQueue
    od.ObjectType = MQOT_Q

    MQCONN od.ObjectQMgrName, gHcon, CompCode, Reason


    'Open a queue
    O_options = MQOO_OUTPUT + MQOO_INQUIRE + MQOO_INPUT_AS_Q_DEF
    MQOPEN gHcon, od, O_options, gHobj, CompCode, Reason


    'MQPUT
    MQMD_DEFAULTS md
    md.Report = MQRO_COPY_MSG_ID_TO_CORREL_ID + MQRO_PASS_CORREL_ID
    md.MsgType = MQMT_DATAGRAM
    md.Expiry = MQEI_UNLIMITED
    md.Format = MQFMT_STRING
    md.Persistence = MQPER_PERSISTENT
    md.ReplyToQ = MyReplyQueue
    md.ReplyToQMgr = MyQueueManager
    md.CodedCharSetId = 1252

    'MQPUT message options
    MQPMO_DEFAULTS pmo
    pmo.Options = MQPMO_NEW_MSG_ID
    buflen = Len(Buffer)

    MQPUT gHcon, gHobj, md, pmo, buflen, Buffer, CompCode, Reason

    'close the connection clĂ´turer une connection + objet
    MQCLOSE gHcon, gHobj, MQCO_NONE, CompCode, Reason
    MQDISC gHcon, CompCode, Reason


    'OPEN a new connection for MyReplyQueue
    MQ_SETDEFAULTS

    MQOD_DEFAULTS od
    od.ObjectQMgrName = ""
    od.ObjectName = MyReplyQueue
    od.ObjectType = MQOT_Q

    MQCONN od.ObjectQMgrName, gHcon, CompCode, Reason

    O_options = MQOO_INPUT_AS_Q_DEF
    MQOPEN gHcon, od, O_options, gHobj, CompCode, Reason

    Dim Getmd As MQMD
    MQMD_DEFAULTS Getmd
    Getmd.MsgType = MQMT_DATAGRAM
    Getmd.Expiry = MQEI_UNLIMITED
    Getmd.Format = MQFMT_STRING
    Getmd.Persistence = MQPER_PERSISTENT
    Getmd.CodedCharSetId = 1252
    Getmd.CorrelId = md.MsgId
    Getmd.MsgId = MQMI_NONE

    'MQGET
    MQGMO_DEFAULTS gmo
    gmo.Version = MQGMO_VERSION_2
    gmo.Options = MQGMO_WAIT + MQGMO_FAIL_IF_QUIESCING + MQGMO_ACCEPT_TRUNCATED_MSG
    gmo.WaitInterval = 1000
    gmo.MatchOptions = MQMO_MATCH_CORREL_ID

    GetBuflen = CCHBUFFER

    MQGET gHcon, gHobj, Getmd, gmo, GetBuflen, GetBuffer, messlen, CompCode, Reason

    MQCLOSE gHcon, gHobj, MQCO_NONE, CompCode, Reason
    MQDISC gHcon, CompCode, Reason

    End


    Any suggestion? thanks a lot+++

  7. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    Getmd.CorrelId = md.MsgId

    Wrong. For your simple example of put msg and then get msg back again, it should be Getmd.MsgId = md.MsgId
    gmo.MatchOptions = MQMO_MATCH_MSG_ID

    ie. There is no need to generate or use a CorrelId.

  8. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    Hi Glenns Screen,

    Actually I made an application that creates xml files and put in on the queue. With the arrival of the message an other application's waking up, uses the files and generates a message on the reply queue.

    It seems that the parameters sent with the put message are not transferred in the reply message. I suppose it's the fact of the other application (on which I have no catch). Anyway I took contact with the developers of this application to have more information about the reply.

    See you on next chapter and thanks again!

  9. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    Ah ah I found it!
    by specifying a new correlId before the Put call (pmo.Options = MQPMO_NEW_CORREL_ID)
    and matching it with the message descriptor in my get call

    Getmd.CorrelId = md.CorrelId
    gmo.MatchOptions = MQMO_MATCH_CORREL_ID

    at last…

  10. Re: 2033 MQRC_NO_MSG_AVAILABLE - VB

    Glad you got it to work.

    MQPMO_NEW_CORREL_ID on your put requests MQ to generate a unique id.

    The other application must copy the CorrelId of the request message to the CorrelId of the reply message.

    It doesn't always work that way. The usual approach is for the other app to copy the MsgId of the request message to the CorrelId of the reply message. That way, the requesting app doesn't need to generate a correl id, it just uses the unique msg id that MQ generates anyway.
    To get the reply message, copy the msg id returned by the put to the correl id field in the msg desc used by the mqget, and do a match on correlid.

    HTH,
    Glenn.

+ Reply to Thread