TomUrick
TomUrick

Reputation: 81

Getting resolved queue name for an alias queue in mq api exit

I am trying to get the resolved queue name (i.e. the base queue name of an alias queue) in open_after and put1_before API exit by looking at ResolvedQName field of Object descriptor(MQOD). But it does not seem to contain the base queue name (i.e. is either blank or is some unexpected value like.. '1.59.15') within these exits. I can however see that the ObjectName has been properly set with the alias queue name. For clarity my alias queue and the base queue both are with the same local QM.

So I am wondering if there is anyway to get the resolved queue name within MQ API exit when making (open + put) or put1 call with alias queue. Any help would be appreciated.

Upvotes: 2

Views: 905

Answers (2)

Roger
Roger

Reputation: 7506

You need to read the MQOD structure in the cmqc.h file. The ResolvedQName field is ONLY available when the application used version 3 (or higher) of the MQOD structure. If you check the version number of the MQOD, I bet you will see it is either version 1 or 2.

Note: The default version number for MQOD is 1. Hence, ResolvedQName field is not available.

Finally, the MQGMO and MQPMO structures both have the ResolvedQName field starting with version 1 of the structures.

Upvotes: 1

T.Rob
T.Rob

Reputation: 31852

I am guessing that you are using the MQPMO_SYNCPOINT option? Are you also using the MQPMO_SYNC_RESPONSE option? Please see the last note on the MQPUT1 topic which states:

When an MQPUT1 call is issued with MQPMO_SYNCPOINT, the default behavior changes, so that the put operation is completed asynchronously. This might cause a change in the behavior of some applications that rely on certain fields in the MQOD and MQMD structures being returned, but which now contain undefined values. An application can specify MQPMO_SYNC_RESPONSE to ensure that the put operation is performed synchronously and that all the appropriate field values are completed.

In other words, the PUT1 is handed off to WMQ and control returned to the program before the name resolution has occurred.

In any case, the PUT1_BEFORE exit point will not have resolved the name. Assuming that MQPMO_SYNC_RESPONSE was specified, you should be able to find it in the PUT1_AFTER exit point.

If you install the API exit from SupportPac MA0W, it parses all the control blocks and flags into English and formats a listing. If you look at the output of that exit, you should be able to see exactly which exit points and fields contain the resolved names and when.

So, be sure to specify MQPMO_SYNC_RESPONSE and consider using the MA0W API exit as a reference and study aid.

Upvotes: 1

Related Questions