In Put MQ API Exit (before or after) is there any way to get the name of the target queue (i.e. the queue against which “put” call has been invoked).
I tried inquiring on Hobj parameter, but got an error saying object has not been opened with Inquiry option (which is a valid possibility).
I also checked ResolvedQName field of pPutMsgOpts parameter, but that was blank.
Is there any other means of getting the target queue name? Any idea would be much appreciated.
The names of the resolved queue manager and resolved queue are returned in the object descriptor accessible during the
MQXR_AFTERcall for the PUT1 or the OPEN.Have a look at the sample program `amqsaxe0.c and you will see the following function signatures:
The object descriptor in the before call has the object name specified by the application. The same structure in the after call has the name of the QMgr and queue that were resolved during the call. Since the PUT1 performs the open, put and close in one step it must resolve the queue name. However in the case of separate open, put(, put…), close calls the name resolution occurs only once during the open.
Please see the samples in
/var/mqm/samporC:\Program Files (x86)\IBM\WebSphere MQ\tools\c\Samplesfor theamqsaxe0.cprogram.