aspose file tools*
The moose likes Websphere and the fly likes JMS - MDB - WebSphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "JMS - MDB - WebSphere" Watch "JMS - MDB - WebSphere" New topic
Author

JMS - MDB - WebSphere

arin paul
Greenhorn

Joined: Sep 07, 2005
Posts: 9
Can I listen to a Dynamic Queue through MDB?
arin paul
Greenhorn

Joined: Sep 07, 2005
Posts: 9
I thought of picking up a message through a static queue (Destination) and having a MDB pick up the Dynamic Queue Name (JMSReplyTo) from the Message and initiating 'Consumer' or 'Receiver' to pick up the messages from Dynamic Queue in the onMessage method of MDB. Is it little far strechted as far as the design goes? Does it break any norms?

Issue is, I have messages from several clients all falling on the same static queue. Client10 has to wait until Client9...Client1 had been processed. This is causing little inconvenience. Having more than one queue is not a work around as clients are spread across Network.

I appreciate your time and thoughts.

AP
Mukesh Mittal
Ranch Hand

Joined: Jan 13, 2006
Posts: 31
You cannot create a listener on dynmic queue.

You have to create static queue and set listener on that. Dynamic replyToQueue is fine. You can easily support 10 clients. Also Do you have multiple instance of server?


Please see the information from sun documentation:
"Like a stateless session bean, a message-driven bean can have many interchangeable instances running at the same time. The container can pool these instances to allow streams of messages to be processed concurrently. The container attempts to deliver messages in chronological order when it does not impair the concurrency of message processing, but no guarantees are made as to the exact order in which messages are delivered to the instances of the message-driven bean class. Because concurrency can affect the order in which messages are delivered, you should write your applications to handle messages that arrive out of sequence. "

"
Mukesh Mittal
Ranch Hand

Joined: Jan 13, 2006
Posts: 31
Another thing:

You can setup maximum session parameter in your Listener. Goto admin console, select server --> Message Listener Service -->Listener Port --> select your listener

You can specify maximum number of concurrent sessions that a listener can have with the JMS server to process messages. Each session correspond to separate listener thread. If you want to process message in specific order then set the value to 1.


Is that answer your question?

Thanks
arin paul
Greenhorn

Joined: Sep 07, 2005
Posts: 9
I appreciate your reply.
I did some reseach and concluded that, as you pointed out in the begining of the posting, I can't have a MDB latched onto a Dynamic Queue.The listener of an MDB depends on a static configuration in the J2EE server.

The application is in production with multiple instances. Concurrent settings, based on the number of processors, set to a number greater than 1 (followed IBM's documentation).

My question is, can I start a Consumer/Receiver in the MDB and grab messages off Dynamic Queue? Is it a design flow?
AP
Mukesh Mittal
Ranch Hand

Joined: Jan 13, 2006
Posts: 31
Are you trying to take name of dynamic queue from static queue message and then from MDB again receive messsage fron dynamic queue.
arin paul
Greenhorn

Joined: Sep 07, 2005
Posts: 9
Yes, that is correct.

My apologies, I should have been little more clear.

Producer creates a Dynamic Queue and posts a request on the Static Queue with the JMSReplyTo set to the Dynamic Queue name.

In 'onMethod' method, consume the messages off the Dynamic Queue either through receiver/consumer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS - MDB - WebSphere