This is part of a series of small blog posts which will cover some of the smaller, perhaps less likely to be noticed, features of IBM MQ. Read other posts in this series.
IBM MQ Queue Managers last a long time. Especially when they are used, as they should be, as a shared resource for many different applications. They are robust, they stay up for months at a time, and definitions made on them can go on forever.
Yup, forever. A queue definition you made for the first application ever deployed to use the queue manager, is probably still there, even though the application is no longer even running. Of course, a good naming convention can help you identify the resources used by a decommissioned application, but there is one other little gem of a feature that you have in your tool box to help.
Each local queue definition has a field on it called RETINTVL (Retention Interval) which allows the administrator to indicate at queue creation time how long this queue will be needed. It's not a field that the queue manager acts upon, so your queue won't suddenly disappear, but it is a great place to document the expected lifespan of the queue, or perhaps the time until it's next review.
It seems to be a little used attribute of queues which few people remember is even there, so it felt like a perfect feature to highlight in this series. The retention interval is specified in hours, but of course for many of your queues you will want a retention interval in months or years, so here is a handy little reference table, to aid you with that.
Timespan |
Number of hours |
Note |
1 month |
744 |
31 days |
1 quarter |
2184 |
91 days |
6 months |
4368 |
182 days |
1 year |
8760 |
365 days |
Applying this interval to your queue definitions can then allow you to query all the queues that have a creation time that is longer ago than the given interval. MQGem products MO71 and MQSCX can help you with this query.
Whichever tooling you use to locate your queues that have lived beyond their retention interval, whether you use it for a review of their use, or as a prompt to delete them, it is certainly a useful little attribute to remember about.
Morag Hughson is an MQ expert. She spent 18 years in the MQ Devt organisation before taking on her current job writing MQ Technical education courses with
MQGem. She also blogs for
MQGem. You can connect with her here on IMWUC or on
Twitter and
LinkedIn.
#Little-Gem#IBMMQ#ChampionsCorner