Author |
Message
|
HMed |
Posted: Tue Dec 13, 2005 5:38 am Post subject: How do I find out the Sending Queue Name in a MDB? |
|
|
Novice
Joined: 17 Sep 2004 Posts: 17 Location: Camp Hill, PA. - USA
|
I have several MDB's that are kicked off when new messages are in their corresponding queues.
Does anybody know how can I get the queue name that the message was initially put into that kicked off the MDB?
I am assuming that I would use the MessageDrivenContext that is available in the MDB, but I'm not sure how to tie that back to the name.
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 13, 2005 5:50 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Do you want this information for logging purposes? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
HMed |
Posted: Tue Dec 13, 2005 9:49 am Post subject: |
|
|
Novice
Joined: 17 Sep 2004 Posts: 17 Location: Camp Hill, PA. - USA
|
Yes, it is for logging.
After looking at this some more, I thought I might be able to get the queue name from the onMessage method with:
((Queue)msg.getJMSDestination()).getQueueName()
but msg.getJMSDestination() is giving me a null pointer exception.
Does anybody have any ideas?
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Dec 13, 2005 10:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't think the JMSDestination on the incoming message will be what you want. The JMSDestination is built on the ReplyToQueue and the ReplyToQmgr. This will only be set if the message expects a reply, and won't ever specify what queue the message is currently on.
A generic MQ message doesn't include information on what queue it is on.
You should see if you can get the session or the consumer associated with your MDB. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 13, 2005 8:37 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The message properties might give you the information you seek.
Jeff you are referring to the JMSReplyTo information...
Anyway the easy way is to ask your WAS admin about the setup of the MDB.
You will get at least the jndi name and your MQ Admin should be able to give you the info you seek
Enjoy  |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Dec 14, 2005 4:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fjb_saper wrote: |
Jeff you are referring to the JMSReplyTo information... |
Don't know how I got those confused. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|