Another in the series of bitesize blog posts about features in MQ V8. Check out the whole series here.
This post is all about a change made in MQ V8 as a direct result of a RFE. If you want to read more about other RFEs that were delivered in MQ V8, this blog post will tell you. RFE 30310 asked for better behaviour when using DEFINE SUB with a blank SUBUSER field on MQ for z/OS.
If you issue this command:-
DEFINE SUB(FRUIT.PRICES) TOPICSTR('Price/Fruit') DEST(FRUIT.STORE.INPUTQ) SUBUSER(HUGHSON)
then the subscription is owned by the user 'HUGHSON' and the context fields and accounting information in the MQMD of any publication messages sent to FRUIT.STORE.INPUTQ, contain information pertinent to that user ID.
If instead the MQ administrator issues this command:-
DEFINE SUB(FRUIT.PRICES) TOPICSTR('Price/Fruit') DEST(FRUIT.STORE.INPUTQ)
i.e. he omits to supply the SUBUSER field, then the subscription is owned by the MQ administrator user ID that issued the command.
This may not be what you wanted and worse still, if that MQ administrator moves on and his user ID is removed from the system at some later point, then these subscriptions will stop working. You can fix this by issuing the following command, but it would be better if we could avoid getting into the problem in the first place.
ALTER SUB(FRUIT.PRICES) SUBUSER(HUGHSON)
So in MQ V8, DEFINE SUB is changed to operate for SUBUSER in the same way that it does for other attributes of a subscription, that is, anything omitted is taken from the SYSTEM.DEFAULT.SUB. This is way all DEFINE commands operate in MQ and should be very familiar to all MQ admins.
If you would prefer all your administratively defined subscriptions to be owned by a specific ID, rather than being owned by the MQ Administrator's ID, you can alter the SUBUSER field of your SYSTEM.DEFAULT.SUB to contain that user ID. Only if the SUBUSER is omitted on the command and also is blank on the SYSTEM.DEFAULT.SUB, will the user ID of the MQ Administrator issuing the command be used. So by default the behaviour continues as before V8, but if you change the default subscription you can have the new behaviour.
So, by example:-
ALTER SUB(SYSTEM.DEFAULT.SUB) SUBUSER(HUGHSON) DEFINE SUB(FRUIT.PRICES) TOPICSTR('Price/Fruit') DEST(FRUIT.STORE.INPUTQ)
Would result in a subscription owned by the user 'HUGHSON'.
Helpfully, this now matches the existing behaviour on the distributed platforms.
Morag Hughson is the WebSphere MQ Base Architect
Find her on: and within IBM on: