To Live AND Die in WebSphere MQ
Gregory(Greg)Bowman 1000007M77 Visits (7624)
Usually when you are faced with a choice it is an either-or kind of choice. You can choose either one or the other. For example, in WebSphere MQ (WMQ), if you have a channel that is trying to deliver a message and it is unable to deliver the message, you have a choice of how that is handled. In the most simplistic view you can choose whether your channel lives OR whether your channel dies. You do this by deciding whether to define a Dead Letter Queue (DLQ) in your queue manager.
Since the earliest days of WebSphere MQ, it has been "best practice" advice to use a Dead Letter Queue (DLQ) for your queue managers. If you are not familiar with a DLQ or the reasons why we recommend to use a DLQ, there is another blog article, "Define a dead-letter queue (DLQ) for each queue manager", which does a very good job of introducing the concept and explaining why you should use one. In most cases, you would choose to let your channel live, but there are a few scenarios where you may want to have your channels terminate.
Consider an example where you have various outside connections coming through a hub queue manager to send messages to the other queue managers in your network. If you have an occasion where unauthorized users are attempting to send messages into your system, you may prefer to have the channel or channels from the hub queue manager terminate, rather than having messages go to a dead letter queue. If this happened in the case of a malicious attack, the attackers may attempt to send large messages to slow your system down with the processing of those messages and you may prefer to have the hub's channels end rather than send those messages to a dead letter queue.
Another possible reason why you may have chosen not to use a DLQ is to preserve message order. If your application or system design is highly dependent on messages arriving in a specific order, it could cause you problems if one or more of your messages were placed on a DLQ for some reason. It may be better for your system design for a channel to die rather to send some of the messages to a DLQ.
There are undoubtedly other reasons in certain specific scenarios where it suits the design of the system or applications to not have messages go to a DLQ. Unfortunately it has always been an either-or choice of whether you would use a DLQ and let your channels Live or not use a DLQ and have all the channels Die. The good news is that now, starting with WMQ V7.1, you can choose BOTH.
In WebSphere MQ V7.1 a new parameter was introduced for WMQ channels, called USEDLQ. The default value is USEDLQ=YES in a channel definition and this means the channel will act like the traditional design of a WMQ channel and send messages to a DLQ for the queue manager that has a DLQ defined. However, you can now select specific channels and set USEDLQ=NO. This will allow that specific channel to act like there was no DLQ defined for the queue manager and that specific channel can terminate in the event that it can not deliver a message to its intended destination. This allows you to now account for those specific cases where you want a channel to act like there is no DLQ and meanwhile your other channels can follow the best practice advice of having a DLQ for the queue manager.
So now USEDLQ allows you the option to let your channels Live AND Die in WMQ. Don't you wish some of your other choices were as easy as this?
Links to information related to USEDLQ:
If you have any comments or questions on this article or if you can think of any other topics you would like to have us discuss, please let me know. If you just want to leave feedback in general, "Remember, We Still Love Your Feedback!"