• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMS - MDB - WebSphere

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I listen to a Dynamic Queue through MDB?
 
arin paul
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic