We all know that we should have a naming convention for our IBM MQ objects (read more about creating one here). Whilst, there will be some IBM MQ users who had the luxury of starting their work with MQ with a naming convention to follow from day 1, I suspect there are many more that retro-fitted a naming convention later. And then there’s sticking to it. It’s all very well designing it, but it’s no use if you don’t follow it when new objects are put in place. Now many MQ users will have very strict policies in place to ensure that naming conventions are stuck to rigidly, but for the rest of us, a helping hand would be very useful.
In V8.0.3 of MO71, a new feature was added to allow you to provide your naming convention in the tool, and have MO71 check it for you as you define new objects; when you run a verify against your objects; and if you do comparisons between two queue managers. All this is based off the global naming pattern you supply in MO71.
To enable use of the naming pattern, open the Preferences dialog, either with Ctrl+P or by choosing menu File->Preferences… The settings you want are on the Naming tab.
The preferences dialog, Naming tab, allows the provision of a naming pattern
In the screenshot you can see a number of the pattern features illustrated. There are required sections, surrounded by round brackets, with the | character meaning OR. So these queues must have a name that begins with SIF or IAA or CDO. There is also an optional section, surrounded by square brackets, with a post fix representing test and development, or nothing for the production version. Although these postfixes are part of the global pattern, it is clear that a single queue manager would only be for test or for production and not mixed!
So, for an individual queue manager you can specify this in the location dialog for the queue manager. Open the location dialog, either with Ctrl+O or by selecting the right-mouse context menu and choosing Open Location… for the selected queue manager.
In the location dialog, switch to the Naming tab where you can input a simpler version of the naming pattern just to provide any specifics from the ORed options in the global pattern, for which ones apply to this queue manager. In our picture this is a test queue manager, so all it’s objects have the postfix *.TST
The Naming tab on the Location dialog gets any specifics
Now that we have the pattern set up, both globally and for each queue manager we can make use of various features in MO71 that take note of the pattern.
Stick to your naming convention
Having set up your naming pattern in MO71, the tool will alert you when you try to define an object which doesn’t match what you said was your naming convention. If this is too harsh a setting for you to start with, the preferences dialog had an option “Only warn when defining a badly named object” which will give you the choice to go ahead with the definition or not.
Verify what is already defined
View any objects which don’t match in Network verify
So that’s newly created objects covered, but what about the hundreds of queues and channels I had defined before I got MO71 V8.0.3? To check out your existing objects, you can use the verify feature of the network view. Open the Network display, either with Ctrl
or by choosing menu View->View Network… You need to select Verify to be in either the left or right hand pane so you can see the problems detected. Ensure that the database icon is green so you know MO71 has some data to analyse, if not you can click on it to get MO71 to go and regather the data. Use menu Action->Re-analyse if you need MO71 to take another look at the data, without regathering it from the queue manager, for example if you have updated the global naming pattern to include something you had forgotten. Now all you need to do is decide what to do about the objects that don’t meet the naming pattern.
Comparing queue managers
With a staged approach to development, test and production of your applications, you may well have a progression of queue managers. As you progress an application from one stage to the next, it would be good to know that you have all the objects it needs defined on the next queue manager to be used. If these naming conventions aren’t exactly the same, say because everything in test is postfixed with TST, then a normal MO71 compare of two queue managers wouldn’t be able to show any differences or missing object definitions. Now that naming patterns are understood by MO71, the comparison dialog also takes them into account, so a queue called SIF.CONTROL.TST would be compared against a queue called SIF.CONTROL on the production queue manager thus allowing you to determine if your test system is truly mimicking your production system.
If this is something you’d like to try out yourself, you can download MO71 from the MQGem website and if you don’t currently have a licence, you may email firstname.lastname@example.org to request a trial licence.