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.
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. "
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.
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