Author |
Message
|
pshan81 |
Posted: Mon Oct 20, 2008 11:41 pm Post subject: MQPubSub Wild card character Issue |
|
|
Acolyte
Joined: 24 May 2005 Posts: 72
|
Hi,
I am getting the below error while using wildcard characters in an MQJMS pubsub java application.
javax.naming.NameNotFoundException: S*
at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400)
at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
I have created the below context structure and topics using JMSAdmin.I want to subscribe to topics Stock and Sport.
Context :pubsub
Sub Context:news
topics : TV,Stock,Sport & Film
However, I am getting the above error on
topic=(MQTopic)ctx.lookup("/pubsub/news/S*"); |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Oct 21, 2008 1:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
That may well be because topic wild card chars are # and +
On the other hand if the topic has not been defined with a wildcard in JNDI you will not be able to retrieve with the wildcard, JNDI is not a DB you need the exact match  _________________ MQ & Broker admin |
|
Back to top |
|
 |
pshan81 |
Posted: Tue Oct 21, 2008 1:58 am Post subject: |
|
|
Acolyte
Joined: 24 May 2005 Posts: 72
|
Thanks for your reply saper.
I have changed the wildcard to # in my java application and created a topic with the name S# using JMSAdmin.Now the application has crossed executing the below line.However,its not subscribing to messages that are posted to the topic Sports or Stock.Am I doing anything wrong?
topic=(MQTopic)ctx.lookup("/pubsub/news/S#"); |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Oct 21, 2008 3:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It may be because the topic root usually does not start with a forward slash:
uri "topic://publish/news/Sports" really has a topic string of "publish/news/Sports" and not "/publish/news/Sports"  _________________ MQ & Broker admin |
|
Back to top |
|
 |
pshan81 |
Posted: Tue Oct 21, 2008 3:48 am Post subject: |
|
|
Acolyte
Joined: 24 May 2005 Posts: 72
|
Thanks saper
Do you mean the topic needs to be created like the below
topic=(MQTopic)ctx.lookup("pubsub/news/S#");
If so, even after doing the above change in the application we are not able to subscribe. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Oct 21, 2008 8:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
try subscribing with RFHUTIL and put the message to a test queue.
Find out why your subscribe message doesn't look like it
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|