|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Create a Topic that has an Else Clause Subscriber. |
« View previous topic :: View next topic » |
Author |
Message
|
RAN001 |
Posted: Tue Feb 16, 2021 10:15 am Post subject: Create a Topic that has an Else Clause Subscriber. |
|
|
Novice
Joined: 14 Feb 2017 Posts: 11
|
IBM MQ 9.2 LUW
We are getting messages from SAP that we want to guarantee, never get lost. AKA always make it to a queue somewhere. This is a very simple example, but he have much more complex examples with many more subscriptions and complicated subscribers. We are using JMS and want to control things at the MQ server.
We have created a topic that we publish to:
Code: |
DEFINE TOPIC(SAP.TRADE.EVENT.T) +
TOPICSTR(SAP.TRADE.EVENT.T) +
USEDLQ(YES) +
REPLACE
DEFINE QLOCAL(SAP.TRADE.EVENT.V1.FXA.Q) +
DEFPSIST(YES) +
MAXDEPTH(250000) +
REPLACE
DEFINE QLOCAL(SAP.TRADE.EVENT.NOMATCH.Q) +
DEFPSIST(YES) +
MAXDEPTH(1000) +
REPLACE
DEFINE SUB(SAP.TRADE.EVENT.V1.FXA.SUB) +
TOPICOBJ(SAP.TRADE.EVENT.T) +
DEST(SAP.TRADE.EVENT.V1.FXA.Q) +
SELECTOR('version=''V1'' AND messagefunction = ''FXA''') +
SUBLEVEL(1) +
REPLACE
DEFINE SUB(SAP.TRADE.EVENT.NOMATCH.SUB) +
TOPICOBJ(SAP.TRADE.EVENT.T) +
DEST(SAP.TRADE.EVENT.NOMATCH.Q) +
SUBLEVEL(0) +
REPLACE
|
We take the messagefunction out of the message. So if a new one of these ever shows up and we don't have a subscriber for it, we want it to preferably go to the SAP.TRADE.EVENT.NOMATCH.Q. (We will alarm if we get messages in this Q) If we can't figure this out, we would like it to go the DLQ as a potential last resort. We have tried the configuration above and as run above, no matter what we do, the message does not end up in the DLQ or the nomatch SUB. when the 'version=''V1'' AND messagefunction = ''BAD'' for example. Has anyone else done this?
I will say if we do delete the SAP.TRADE.EVENT.V1.FXA.SUB then a "BAD" message will end up in the NOMATCH.SUB.
Thanks in Advance,
Andy |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Feb 16, 2021 2:30 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Can you explain your reasons for using SUBLEVEL ? _________________ Glenn
Last edited by gbaddeley on Wed Feb 17, 2021 1:49 pm; edited 1 time in total |
|
Back to top |
|
 |
hughson |
Posted: Tue Feb 16, 2021 3:11 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
A SUBLEVEL(0) subscription should only get a publication message if none could be delivered to the SUBLEVEL(1) subscription(s).
It would appear that matching the topic, but not matching the selector counts as 'delivered'. This feels wrong to me, as I suspect it does to you.
Interestingly, in your scenario, if the publisher asks for MQPMO_WARN_IF_NO_SUBS_MATCHED it will be returned MQRC_NO_SUBS_MATCHED. This seems inconsistent with the above behaviour as it is not going down to the SUBLEVEL(0) subscriptions because it seems like it thinks it has matched something.
I would argue that if no SUBLEVEL(1) subscriptions were matched then the SUBLEVEL(0) should be sent the message.
I suspect you should ask IBM to look into this as this seems somewhat defective to me. Just my two cents.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
RAN001 |
Posted: Wed Feb 17, 2021 7:25 am Post subject: |
|
|
Novice
Joined: 14 Feb 2017 Posts: 11
|
Morag answered the sublevel question well, I am just providing the documentation to reference:
https://www.ibm.com/support/knowledgecenter/SSFKSJ_9.2.0/com.ibm.mq.dev.doc/q026710_.htm
Quote: |
A subscriber with a SubLevel of 0 is used as a catchall. It receives the publication if no final subscriber gets the message. A subscriber with SubLevel of 0 might be used to monitor the publications that no other subscribers received.
|
Thanks all for your help.
Andy |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|