IBM Support

MQ Pub/Sub: is it possible to specify the priority for delivering a message to Subscribers? can Subscriber-1 get the message even if Subscriber-2 has a full queue?

How To


Summary

Questions:
a) Is it possible to specify the priority for a Subscriber-1 to receive a published message before Subscriber-2?
b) Is it possible to specify that if Subscriber-1 fails to get a message (such as durable queue is full), then Subscriber-2 still gets the message?

Steps

+++
+++ Answer for question 'a':
+++
.
Yes, IBM MQ has a feature called "SubLevel".
.
For more details, please see the following comprehensive blog:
https://community.ibm.com/community/user/imwuc/blogs/morag-hughson/2020/02/14/ibm-mq-little-gem-45-sublevel
IBM MQ Little Gem #45: SubLevel
By Morag Hughson, 15-Feb-2020
.
+ Begin excerpt
.
If you have subscribing applications that need to see a publication before other subscribers, you might find that the SubLevel option is useful for you.
.
This feature of IBM MQ Pub/Sub was designed for applications that filter out certain publications, or perhaps annotate the contents of the publication message before sending it on for other subscribers to see. It might even be used to implement tiering of subscriptions, delaying the delivery to lower tiered subscribers until the highest tier has had their delivery.
.
+ End excerpt
.
.
+++
+++ Answer for question 'b':
+++
.
In practice, there are some delivery aspects that can be controlled by the Publisher.
.
The following presentation has details that may provide helpful for what you are looking for:
.
https://mqtechconference.com/sessions_v2013/MQTC-PubSub_Part_I.pdf
Presentation: PubSub Part 1
.
Page 30 - see picture in that page
.
+ begin excerpt
Question: What if a failure occurs on message delivery?
.
MSGDLV behavior
ALL If one failure – no-one gets it
ALLDUR Any failure to a durable subscriber – no-one gets it
ALLAVAIL Failures don’t affect the delivery to subscribers who can accept it
.
MQRC_PUBLICATION_FAILURE
.
TOPIC attributes
PMSGDLV (ALLDUR)
NPMSGDLV (ALLAVAIL)
.
+ end excerpt
.
.
Page 31 - Here are the notes:
.
+ begin excerpt
.
If a publication satisfies a number of subscribers and the queue manager is unable to deliver the publication to one of the subscribers, say because its destination queue is full (and additionally the message cannot be placed on the Dead Letter Queue (DLQ) either because it is not being used or because it is out of commission for some reason) – what happens?
Well, there are essentially three choices and these are configured on the topic in question using the PMSGDLV and NPMSGDLV attributes – so different behavior can be configured for persistent and non-persistent messages on the topic.
.
You can configure your system so that all subscribers must be delivered the publication or none of them get it. This is the value ALL.
If one of the subscribers cannot accept it as in our diagram, the MQPUT fails with MQRC_PUBLICATION_FAILURE.
.
You can configure your system so that all durable subscribers must be delivered the publication or none of them get it. This is the value ALLDUR.
If one of the durable subscribers cannot accept it as in our diagram, the MQPUT fails, again with MQRC_PUBLICATION_FAILURE.
.
You can configure your system so that no failure of one specific subscriber has any affect on the delivery of the publication to other subscribers. This is the value ALLAVAIL.
.
+ end excerpt

Document Location

Worldwide

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All versions","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
18 February 2020

UID

ibm11274944