Topic
  • 2 replies
  • Latest Post - ‏2013-04-26T05:54:43Z by MandarS
MandarS
MandarS
9 Posts

Pinned topic MQPUT while using MQCB : MQRC_HCONN_ASYNC_ACTIVE

‏2013-04-23T07:29:28Z |
Hi, 

Our process needs to read messages from a topic on the local Q manager and also write to a different topic on the same local Q manager. 

To read messages we have used MQCB. The messages reach the callback function of the process. However, while the callback remains registered, we are not able to MQPUT messages to a different topic. 

We get an error that says: 
2500 : MQRC_HCONN_ASYNC_ACTIVE 
An attempt to issue an MQI call has been made while the connection is started 

Apparently, a single connection handle cannot be used to both read and write. We have to Suspend the MQCB, MPUT the message and Resume the MQCB to get it to work. 

Is there a way to avoid having to suspend and resume? 

Thanks, 
MandarS

 

  • Morag Hughson
    Morag Hughson
    140 Posts

    Re: MQPUT while using MQCB : MQRC_HCONN_ASYNC_ACTIVE

    ‏2013-04-23T13:09:32Z  

    If your MQPUT is due to a message you have retrieved with the MQCB, then you can go the MQPUT inside the call-back function. If however, you need to do unrelated MQPUTs outside of the callback function, then you must suspend the MQCB as you have discovered. This is because when you issue MQCTL(start) you give up the hConn for use by the callbacks, so you cannot use it for anything else.

    If you don't want to suspend and resume the callback, then the alternative option is to have two hConns.

    Cheers
    Morag

  • MandarS
    MandarS
    9 Posts

    Re: MQPUT while using MQCB : MQRC_HCONN_ASYNC_ACTIVE

    ‏2013-04-26T05:54:43Z  

    If your MQPUT is due to a message you have retrieved with the MQCB, then you can go the MQPUT inside the call-back function. If however, you need to do unrelated MQPUTs outside of the callback function, then you must suspend the MQCB as you have discovered. This is because when you issue MQCTL(start) you give up the hConn for use by the callbacks, so you cannot use it for anything else.

    If you don't want to suspend and resume the callback, then the alternative option is to have two hConns.

    Cheers
    Morag

    hi Morag,

    We created two connections using MQCNO_HANDLE_SHARE_BLOCK as connection options. Once again thanks a lot,

    ~MandarS