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 » IBM MQ Java / JMS » Topic Wildcard Problem

Post new topic  Reply to topic Goto page 1, 2  Next
 Topic Wildcard Problem « View previous topic :: View next topic » 
Author Message
semasaba
PostPosted: Wed May 21, 2008 3:50 am    Post subject: Topic Wildcard Problem Reply with quote

Novice

Joined: 21 May 2008
Posts: 17

Hi all,
I wrote a small JMS publisher example and everything works fine.
The only problem is to use a wildcard for my topic.
When I insert a wildcard '*' for my publisher topic, I get following error:
com.ibm.mq.jms.BrokerCommandFailedException: Broker command failed: MQRCCF_TOPIC_ERROR Reason code 3072

Here my example:

MQTopicConnectionFactory cf = new MQTopicConnectionFactory();

// Config
cf.setHostName("myHost");
cf.setPort(myPort);
cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
cf.setQueueManager("myQueue");


TopicConnection connection = cf.createTopicConnection("MUSR_MQADMIN","");
// Start the connection
connection.start();

TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = session.createTopic("topic://TravelGuides/*" );

TopicPublisher publisher = session.createPublisher(topic);
Message message = session.createTextMessage();
publisher.publish(message); //<--Exception!!!!

Thanks a lot!
Marco
Back to top
View user's profile Send private message
AkankshA
PostPosted: Wed May 21, 2008 3:57 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

Might be of help.... not sure though considering my illiteracy for java


from infocenter

Quote:
This reason code is returned by a broker to indicate that the topic name has an invalid length or contains invalid characters. Note that wildcard topic names are not allowed for Register Publisher and Publish commands. See WebSphere® MQ Publish/Subscribe User's Guide for more information on this error code

_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Wed May 21, 2008 4:01 am    Post subject: Re: Topic Wildcard Problem Reply with quote

Grand High Poobah

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

semasaba wrote:
The only problem is to use a wildcard for my topic.


How can a topic be published with a wildcard?

I don't just mean the software throws an error if you try, I mean logically, from a design perspective, how can a topic which contains a discrete body of information be described as "well it's all this"?

What's your requirement here?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
semasaba
PostPosted: Wed May 21, 2008 4:53 am    Post subject: Reply with quote

Novice

Joined: 21 May 2008
Posts: 17

wow, thank you for the fast reply.
My scenario is to have many clients/subscriber which are listening for a message. I want to seperate the clients in several groups because I don't want to send the message to all clients. Therefore I want to create hirarchical groups and want to control the receivers with topics an wildcards.

Example page 17 in following pdf:
http://www.gse-nordic.org/Working%20Groups/NRTC/Conferences/2006/WMQ%20Stream/s77?bcsi_scan_0DA4E610D57C1B1B=eIHbldT1ymS77nVUm9pEoDQAAAA1f+ce:1
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 21, 2008 4:58 am    Post subject: Reply with quote

Grand High Poobah

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

semasaba wrote:
wow, thank you for the fast reply.
My scenario is to have many clients/subscriber which are listening for a message. I want to seperate the clients in several groups because I don't want to send the message to all clients. Therefore I want to create hirarchical groups and want to control the receivers with topics an wildcards.


Yes, but why publish with a wildcard? Page 17 of your included presentation talks (rightly) about subscribing with a wildcard, and I agree you could use this to group subscribers. But again I ask why publish with a wildcard? What is that supposed to represent? Does it not (even if it worked) defeat your grouping concept by allowing multiple subscriber groups to access it?
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Wed May 21, 2008 5:01 am; edited 1 time in total
Back to top
View user's profile Send private message
semasaba
PostPosted: Wed May 21, 2008 4:59 am    Post subject: Reply with quote

Novice

Joined: 21 May 2008
Posts: 17

what's your advice for this scenario?
How would you do that?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 21, 2008 5:02 am    Post subject: Reply with quote

Grand High Poobah

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

semasaba wrote:
what's your advice for this scenario?
How would you do that?


I'd do what it describes in the presentation you included. Which seems to be more or less what you described as your proposed solution.

I'm still struggling to see what you're attempting to achieve here over & above a "normal" pub/sub scenario. Because you seem (from the details you've provided) to have a fairly normal pub/sub scenario.

There is clearly a complexity I'm missing.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
semasaba
PostPosted: Wed May 21, 2008 5:09 am    Post subject: Reply with quote

Novice

Joined: 21 May 2008
Posts: 17

I really don't know what you mean .
What's the difference between my example and the pdf?
Have you seen page 17 in this pdf?
He's also using wildcards in his topic to group the receivers?
That's exactly what I want!
Do you have any precise advices?
Back to top
View user's profile Send private message
semasaba
PostPosted: Wed May 21, 2008 5:13 am    Post subject: Reply with quote

Novice

Joined: 21 May 2008
Posts: 17

ah ok!
I think I understand know what you mean.
The difference is that I use wildcards for the publisher instead for the subscriber.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 21, 2008 5:16 am    Post subject: Reply with quote

Grand High Poobah

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

semasaba wrote:
What's the difference between my example and the pdf?


The topic names you're attempting to publish

semasaba wrote:
Have you seen page 17 in this pdf?


Oddly, I had a look before I replied to your post. I felt it would help.

semasaba wrote:
He's also using wildcards in his topic to group the receivers?


I believe so. It's a common enough construct.

semasaba wrote:
That's exactly what I want!


It certainly sounds like it. I still fail to see what this has to do with the publish problem you're quoting, or what these topics you're publishing are describing. Again I ask what, conceptually, do these topics describe?

semasaba wrote:
Do you have any precise advices?


Frankly, use the conventional pub/sub model. It seems to fit your needs and is less trouble than whatever it is you're building here.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 21, 2008 5:18 am    Post subject: Reply with quote

Grand High Poobah

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

semasaba wrote:
The difference is that I use wildcards for the publisher instead for the subscriber.


Exactly. What does a topic, published with a wildcard in it's topic name, describe? It describes a topic which is more than one thing and valid for more than one subscriber. This doesn't appear to be the desired result you're describing.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
semasaba
PostPosted: Wed May 21, 2008 6:37 am    Post subject: Reply with quote

Novice

Joined: 21 May 2008
Posts: 17

Ok, thank you.
Do you have any idea how to solve my problem?
If you view the example from the pdf, how should
I describe the publisher and the subscriber if I want to
send the first time a message only to Tyrol and after that a massage
to Austria. If I sent a message to Austria, all subscribers from subtopics should be informed.

First case:
Publisher -> TravelGuides/Austria/Regions/Tyrol
Subscriber -> TravelGuides/Austria/Regions/Tyrol

Second case:
Publisher -> TravelGuides/Austria/
Subscriber -> ???


For the second case I don't want to create a new subscriber. Is it possible to modify the subscriber to use it for both cases?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 21, 2008 6:48 am    Post subject: Reply with quote

Grand High Poobah

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

semasaba wrote:
For the second case I don't want to create a new subscriber. Is it possible to modify the subscriber to use it for both cases?


Yes.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 21, 2008 1:22 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

semasaba wrote:
Ok, thank you.
Do you have any idea how to solve my problem?
If you view the example from the pdf, how should
I describe the publisher and the subscriber if I want to
send the first time a message only to Tyrol and after that a massage
to Austria. If I sent a message to Austria, all subscribers from subtopics should be informed.

First case:
Publisher -> TravelGuides/Austria/Regions/Tyrol
Subscriber -> TravelGuides/Austria/Regions/Tyrol

Second case:
Publisher -> TravelGuides/Austria/
Subscriber -> ???


For the second case I don't want to create a new subscriber. Is it possible to modify the subscriber to use it for both cases?

A subscriber can subscribe to multiple topics.

So general topics would be
Publisher->TravelGuides/Austria
Subscriber->TravelGuides/Austria
Subscriber->TravelGuides/Austria/# -- would receive everything to do with Austria
Subscriber->TravelGuides/Austria/Regions -- generic regions stuff valid for all regions
Subscriber->TravelGuides/Austria/Regions/Tyrol -- redundant if you use the "everything to do with Austria".

It all depends on what you publish where and how...

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
semasaba
PostPosted: Fri May 23, 2008 12:03 am    Post subject: Reply with quote

Novice

Joined: 21 May 2008
Posts: 17

fjb_saper wrote:

A subscriber can subscribe to multiple topics.


How can I subscribe one subscriber to multiple topics ?
.....
TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = session.createTopic("topic://TravelGuides/*" );
TopicSubscriber subscriber = (TopicSubscriber) session.createSubscriber(topic);
....

I think I have exactly the same problem like scottj2512:
http://www.mqseries.net/phpBB2/viewtopic.php?t=41643&sid=25ad75b97d7a6728537b6a73837e0fe6

Once again:
I have these three publisher:
Publisher 1->TravelGuides/Austria/Regions/Tyrol
Publisher 2->TravelGuides/Austria/Regions/Salzburg
Publisher 3->TravelGuides/Austria/
and I want two subscriber:
Subscriber 1-> receive message from publisher 1+3
Subscriber 2-> receive message from publisher 2+3
Is that not possible?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Topic Wildcard Problem
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.