ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Tracing publish subscribe errors

Post new topic  Reply to topic
 Tracing publish subscribe errors « View previous topic :: View next topic » 
Author Message
rmah
PostPosted: Tue Jun 17, 2008 10:56 am    Post subject: Tracing publish subscribe errors Reply with quote

Centurion

Joined: 04 May 2007
Posts: 142

Hi,

I was wondering if there was a way to trace or see the output/error when a message flow tries to publish to a non-existent topic. We've checked /var/log/messages and there's nothing there, as well as the MQ error log files. The messages simply disappear without error.

Is there a way to trace pub/sub outcomes?

Thanks!


_________________
MQ 6.0.2.3
Broker 6.0.0.7
for Linux
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jun 17, 2008 11:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It is not an error for a message to be published when there are no subscribers to receive it.

This is the "blog" model of pub/sub, according to MarkT (who is probably annoyed that I stole his line). One publisher, zero consumers.

Pub/sub insists on absolutely no connection between publisher and subscribers.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
boos
PostPosted: Thu Apr 10, 2014 7:54 am    Post subject: Publishing to a non existing topic Reply with quote

Apprentice

Joined: 27 Jan 2004
Posts: 36
Location: Netherlands

I have the same question (and was going to make a topic when I found this one).
It seems the answer given is not an answer to the question.

The Question:
How can I know if I try to publish a message to a non-existing topic (which is something else than publishing to a topic that has no subscribers to which Jefflowrey made a clear answer).

I have tried it in an application as well as publishing via MQexplorer. In both cases the publication is accepted without so much as an MQRC. And there is no queue where I can find any message (I thought that maybe the deadletter queue could contain it or some system queue). Our Topics are fixed (not variable). http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.csqzal.doc%2Fps10433_.htm

I would expect that trying to publish to a non existent topic would result in an error message (why else would you have to define a Topic, if a subscription is sufficient).

So the question again:
How can we (the application) detect that we are publishing to a topic that has not been defined ?

We’re using MQ v7.5.0.2
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 10, 2014 8:12 am    Post subject: Re: Publishing to a non existing topic Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

boos wrote:
How can I know if I try to publish a message to a non-existing topic (which is something else than publishing to a topic that has no subscribers to which Jefflowrey made a clear answer).


Is it? I'm not aware (and stand ready to be corrected) that there's any enfocement in the pub/sub model where a topic needs to be pre-defined any more than a topic needs to have subscribers.

boos wrote:
I would expect that trying to publish to a non existent topic would result in an error message (why else would you have to define a Topic, if a subscription is sufficient).


There are a number of reasons why you might want to define a topic; to load balance via a cluster alias for example. There are a number of reasons why you would not.

boos wrote:
So the question again:
How can we (the application) detect that we are publishing to a topic that has not been defined ?

We’re using MQ v7.5.0.2


Let me ask you this question: when you put (not publish) a message how do you as an application know that someone is going to consume it? You reasonably assume there's an application on the far side reading them, but as an application you don't know.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Thu Apr 10, 2014 8:21 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5850
Location: UK

Define topic objects and then MQ ACLs on these to control publication rights.

Then the use of a topic string outside the admin permissions will be failed assuming you haven't done something dumb like give the application mqm authority.

Remember that admin topic objects can be defined at any point on the topic tree - it does not need to (and probably shouldn't) be right at the longest part of it.

Publishing to a topic string that is allowed by these access rights, but that does not have a subscriber is fine, the entire point of pub/sub is to de-couple the sender and receiver(s) if any.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
umatharani
PostPosted: Thu Apr 10, 2014 8:45 am    Post subject: Reply with quote

Apprentice

Joined: 23 Oct 2008
Posts: 39

Hi,

It is possible to monitor publications with no matching subscribers using sublevel.

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.dev.doc/q026710_.htm

Thanks,
mahesh
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 10, 2014 8:59 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

umatharani wrote:
It is possible to monitor publications with no matching subscribers using sublevel.

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.dev.doc/q026710_.htm


I don't see how that a) correlates b) is available to the publishing app

Could you expand on this a little?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
umatharani
PostPosted: Thu Apr 10, 2014 6:09 pm    Post subject: Reply with quote

Apprentice

Joined: 23 Oct 2008
Posts: 39

Hi,

It is a combination of publevel and sublevel. The infocenter topic explains in detail with examples.

Excerpt from infocenter:

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.

Regards,
mahesh
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 11, 2014 4:30 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

umatharani wrote:
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.


Granted.

How does this help the publishing app (the topic under discussion)?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
boos
PostPosted: Fri Apr 11, 2014 4:30 am    Post subject: Reply with quote

Apprentice

Joined: 27 Jan 2004
Posts: 36
Location: Netherlands

From this discussion I derive 3 possible solutions

Checking if a publication is not delivered to any subscribers
http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq026730_.htm by adding the put option MQPMO_WARN_IF_NO_SUBS_MATCHED we should get a warning if a publication attempt is made on a topic that has no subscriptions (in our case, the static topics always have at least 1 subscription). So a publication to an unkown topic should at least get a MQRC_NO_SUBS_MATCHED (which is sufficient in our case)

And the second suggestion is also a valid one (as zpat suggested) by setting the right authorisations on the known topics (so publishing to an unkown topic should result in een authorisation error).

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq026710_.htm
The third option as suggested is umatharani is an interesting one (I didn’t know anything about different levels for pubs and subs). Which can work as a ‘catch all’ if done at the lowest level with some wildcard. This wouldn’t be a solution for our case since the pubbing application wouldn’t recieve an error when pubbing. It is helpfull though because in this solution the message wouldn’t disappear because it would be delivered to some queue that is being monitored to inform an operator.

Thanks for all the help (and insightfull info).
Boos
[Edit: corrected some typos]


Last edited by boos on Fri Apr 11, 2014 4:51 am; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 11, 2014 4:36 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

boos wrote:
Checking if a publication is not delivered to any subscribers
http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq026730_.htm by adding the put option MQPMO_WARN_IF_NO_SUBS_MATCHED we should get a warning if a publication attempt is made on a topic that has no subscriptions (in our case, the static Topics always have at least 1 subscription). So a publication on an unkown topic should at least get a MQRC_NO_SUBS_MATCHED (which is sufficient in our case)


And I've learned about a put option I was unaware of when I got up this morning; yay!


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Apr 11, 2014 4:45 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7716

Vitor wrote:
boos wrote:
Checking if a publication is not delivered to any subscribers
http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq026730_.htm by adding the put option MQPMO_WARN_IF_NO_SUBS_MATCHED we should get a warning if a publication attempt is made on a topic that has no subscriptions (in our case, the static Topics always have at least 1 subscription). So a publication on an unkown topic should at least get a MQRC_NO_SUBS_MATCHED (which is sufficient in our case)


And I've learned about a put option I was unaware of when I got up this morning; yay!



Try and get to Chris Frank's 2 Pub Sub sessions at this year's 2014 MQ Tech Conferance, assuming he'll be there again. In 2013 I learned tons of new stuff in those sessions, like these nifty put options.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 11, 2014 4:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PeterPotkay wrote:
Vitor wrote:
boos wrote:
Checking if a publication is not delivered to any subscribers
http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/index.jsp?topic=%2Fcom.ibm.mq.dev.doc%2Fq026730_.htm by adding the put option MQPMO_WARN_IF_NO_SUBS_MATCHED we should get a warning if a publication attempt is made on a topic that has no subscriptions (in our case, the static Topics always have at least 1 subscription). So a publication on an unkown topic should at least get a MQRC_NO_SUBS_MATCHED (which is sufficient in our case)


And I've learned about a put option I was unaware of when I got up this morning; yay!



Try and get to Chris Frank's 2 Pub Sub sessions at this year's 2014 MQ Tech Conferance, assuming he'll be there again. In 2013 I learned tons of new stuff in those sessions, like these nifty put options.



So Noted
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Tracing publish subscribe errors
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.