Author |
Message
|
gpklos |
Posted: Fri Mar 06, 2009 8:50 am Post subject: Durable messages always go to same queue? Why? |
|
|
Centurion
Joined: 24 May 2002 Posts: 108
|
I have a user that is trying to run a JMS PUB SUB program with durable messages (topics). We have run his program to use NON-durable and it works fine. I created subscription queues with the names SYSTEM.JMS.ND.SB.JMS_TEST.SUBQ, which is an ALIAS for SB.JMS_ND_TEST.LQ. When they use their program for Non Durable subscriptions the messages end up on the SB.JMS_ND_TEST.LQ, as expected. Now I also created a SYSTEM.JMS.D.SB.JMS_TEST.SUBQ alias for durable messages that point to SB.JMS_D_TEST.LQ. Now when
he goes to publish a message that is supposed to end up on the SB.JMS_D_TEST.LQ, for some reason the messages keep going to the default Durable queue of SYSTEM.JMS.D.SUBSCRIBER.QUEUE. I looked in
the program code and based on an input variable he does set the subscriber queue to SYSTEM.JMS.D.SB.JMS_TEST.SUBQ. I know it is definitely going to the SYSTEM.JMS.D.SUBSCRIBER.QUEUE because if I put disable the queue the program fails because the broker can't put to the queue. So it is like it is completely ignoring the queue I'm telling it to go to. I think he is using JMS 1.1. I am the mqadmin so I don't know
a great deal about the pub sub and what the official rules are. I'm reading when I can but still kind of hard to pick up all the details without doing the coding.
His input parameters to the program are
QUEUEMANAGER=USTA
BROKERQUEUEMANAGER=USTA
QMHOSTNAME=USTA.psc.uss.com
QMPORT=1414
CHANNEL=SB.USTA.CL
CONTROLQUEUE=SYSTEM.BROKER.CONTROL.QUEUE
PUBQUEUE=SB.JMS_TEST_STREAM.STREAM
DURABLE=Y
NDSUBQUEUE=SYSTEM.JMS.ND.SB.JMS_TEST.SUBQ
DSUBQUEUE=SYSTEM.JMS.D.SB.JMS_TEST.SUBQ
PUBTOPIC=uss/bsc/test
SUBTOPIC=uss/bsc/test
MESSAGE=Test Message
CLIENTID=CLIENT200
SUBSCRIBERID=TESTSUB
The code where he sets the durable queue based upon the variable DURABLE above is below. I've verified
that the mQParams.get("DSUBQUEUE")) does indeed pull in the correct queue name of SYSTEM.JMS.D.SB.JMS_TEST.SUBQ.
MQTopicConnectionFactory factory = new MQTopicConnectionFactory();
factory.setQueueManager(mQParams.get("QUEUEMANAGER"));
factory.setBrokerQueueManager(mQParams.get("BROKERQUEUEMANAGER"));
factory.setTransportType(1);
factory.setHostName(mQParams.get("QMHOSTNAME"));
factory.setPort(Integer.parseInt(mQParams.get("QMPORT")));
factory.setChannel(mQParams.get("CHANNEL"));
factory.setBrokerControlQueue(mQParams.get("CONTROLQUEUE"));
factory.setBrokerPubQueue(mQParams.get("PUBQUEUE"));
TopicConnection connection = null;
if ("Y".equals(mQParams.get("DURABLE"))) {
factory.setClientID(mQParams.get("CLIENTID"));
factory.setBrokerSubQueue(mQParams.get("DSUBQUEUE"));
} else {
factory.setBrokerSubQueue(mQParams.get("NDSUBQUEUE"));
}
Thanks for any help you can provide.
Gary |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Mar 07, 2009 12:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to change the subscription to specify the new delivery queue.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gpklos |
Posted: Sat Mar 07, 2009 4:13 pm Post subject: |
|
|
Centurion
Joined: 24 May 2002 Posts: 108
|
I thought that is what the code below does. Again I'm not the programmer, so I am kind of learning as I go. I will have to forward this info to the programmer. Supposedly they have coded some pub sub stuff before so I was figuring they knew what they were doing.
factory.setBrokerSubQueue(mQParams.get("DSUBQUEUE"));
Thanks for the quick response.
Gary  |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Mar 07, 2009 6:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The ONLY way to change the specific delivery point of a subscription is to change said subscription. Look at RFHUtil on how to do that. What you did was to attempt to change the default delivery point of subscriptions that do not specify a delivery point... And I don't think this would have changed any delivery point on durable subscription. You HAVE to CHANGE the Subscription.... Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gpklos |
Posted: Wed Mar 18, 2009 9:40 am Post subject: |
|
|
Centurion
Joined: 24 May 2002 Posts: 108
|
Two things I failed to mention. We are using MQ version 6.0 and the basic MQ PUB SUB that comes with MQ 6.0. Is it still possible to have durable publications go to specific subscription queues with V6? I ask because I was playing with RFHUTIL, and noticed the tabs that make any use of durable queues, is only for MQ 7. Now the programmers are going to be using JMS 1.1 to do the pub sub programming.
Part of the problem is I am not a coder, so I don't know the rules of pub sub. Again trying to learn them in my "spare" time, on behalf of the programmers.
Thanks again,
Gary |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 18, 2009 3:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gpklos wrote: |
Two things I failed to mention. We are using MQ version 6.0 and the basic MQ PUB SUB that comes with MQ 6.0. Is it still possible to have durable publications go to specific subscription queues with V6? I ask because I was playing with RFHUTIL, and noticed the tabs that make any use of durable queues, is only for MQ 7. Now the programmers are going to be using JMS 1.1 to do the pub sub programming.
Part of the problem is I am not a coder, so I don't know the rules of pub sub. Again trying to learn them in my "spare" time, on behalf of the programmers.
Thanks again,
Gary |
No this should be possible.
Go back to basics and look at your subscription topic definition.
Use JMSAdmin and a file based JNDI.
Create the subscription topic and display it with all attributes.
You should then see the attribute for the subscription queue.
Use the defined ALIAS with SYSTEM.JMS....
You may want to inspect the message before sending it to the broker with a JMS app so as to get the URI form of the topic...
Your subscription topic could look something like...
"topic://mytopicroot/#?brokerDurSubQueue=SYSTEM.JMS.D.MYQUEUE&brokerVersion=1";
Note that this example will not work as the wildcard character is for a Version 2 broker....
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gpklos |
Posted: Fri Mar 20, 2009 11:30 am Post subject: |
|
|
Centurion
Joined: 24 May 2002 Posts: 108
|
Now according to the IBM Java MQ documentation, I can set the durable subscriber queue name in 1 of 2 ways which are listed below. The programmers want to use a Multiple Queue approach, which according to the documentation means I have to name the queue SYSTEM.JMS.D.myqueue.*. Because Durable subscriptions with a multiple queue approach uses Dynamic queues. So I guess that means I can't use a queue alias as I originally wanted. Correct.
1. Use the WebSphere MQ JMS administration tool (for JNDI retrieved objects) to set the BROKERDURSUBQ property
2. Use the setBrokerDurSubQueue() method in your program:
// Set the MQTopic durable subscriber queue name using
// the multi-queue approach
sportsTopic.setBrokerDurSubQueue("SYSTEM.JMS.D.FOOTBALL.*");
Also the programmers are using regular JAVA JMS, not the MQ java JMS that comes with MQ. This implementation does not provide the setBrokerDurSubQueue() method. The reason they are using that implementation is because ultimately some other implementation that comes with oracle will be used which won't have setBrokerDurSubQueue. It will only have setBrokerSubQueue. So that is why I ask if this can be done without having the setBrokerDurSubQueue method.
If they use a JNDI, can they get around not using the setBrokerDurSubQueue method?
As always thanks again,
Gary |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Mar 21, 2009 9:04 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Use JNDI. The topic is then setup in JNDI and your subscription queue comes with the Topic JNDI....
You mean to say that ultimately you're going to run this thing in AQ?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
fireguok |
Posted: Wed Mar 25, 2009 5:55 am Post subject: |
|
|
Novice
Joined: 03 Apr 2007 Posts: 22
|
I have the same issue. The message is always published to the default queue ever I already defined the BROKERDURSUBQ.
Hi gpklos,
Have you figured out?
Thanks in advance. |
|
Back to top |
|
 |
gpklos |
Posted: Wed Mar 25, 2009 11:54 am Post subject: |
|
|
Centurion
Joined: 24 May 2002 Posts: 108
|
Well I didn't figure it out myself. The coders eventually figured out some things based on this post. Here is what the coder said to get this to work. He got it to work 2 out of 3 ways. He is still trying to get it to work with JNDI on WAS. See quote below.
[quote]"The durable subscriptions using custom subscription queues are working both in JMS and Oracle SOA Suite. In JMS we need to set the custom subscription queue at the topic level rather than at the topic connection factory level. setBrokerDurSubQueue method of MQTopic class can be used to set this.
In Oracle SOA Suite, I have set the durable subscription queue as part of the destination (topic) name. The topic URI looks like below:
topic://uss/bsc/news?brokerDurSubQueue=SYSTEM.JMS.D.SB.JMS_TEST.SUBQ
I tried to test the durable subscriptions in Websphere Application Server by creating the TopicConnectionFactory and Topicas JNDI administered objects but I am getting MQJMS3024: Illegal use of uninitialized clientIdexception even though I am setting the CLIENTID in the TopicConnectionFactory in the similar way we did in the JMS program. I still need to investigate why this exception is occuring.
"[/quote]
Again thanks to fjb_saper for his help.
I do have an additional question. I am the mq admin and can use MQ Explorer to see all the topics, subscribers, publishers. Our programmer also uses the MQ explorer support pack that you can download. He tries to see the subscribers, etc using the TOPIC plug in, except he can't see all the TOPIC Names. Which could be a security issue. However for the topics he can see, he right clicks and asks to see the subscribers (there are a handful), but nothing comes back for the subscribers or for publishers for that matter. And they do exist, plus the id he uses to run mq explorer is one of the subscriber ids. I don't see any security errors in the logs or the event viewer, so I don't even know what to change in security.
Any ideas on this one?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Mar 26, 2009 3:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Don't know if the tools you are looking at are adequate for the task.
IBM has some programs that come with the pub/sub engine that may give you most of the info you are looking for. They generally need to be run by an admin though.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|