• 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

asynchronous jms consumer

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I want to create an asynchronous jms consumer.
The problem is that i do not want create a message driven bean.
I have a session bean that dynamically read from data base the name of the queue listened.
So i wonder if exists a way for implementing a asynchronous jms consumer.
Please help!!!
Regards
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at:

QueueReceiver

MessageConsumer

Though the following example is from jboss articles, this is not specific to jboss, and can be used as a reference:

Example from JBoss
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

asynchronous jms consumer



Thought about your question once again. Do you mean to say, your consumer should act similar to MDB(which get invoked when the message arrives on queue). If yes, then the links that i provided in my previous post may not be useful, because, the QueueReceiver uses the receive method(which is a blocking, i.e. synchronous method) *waits* for a message to arrive on the queue.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use MessageListener for receiving asynchronous messages
http://java.sun.com/j2ee/1.4/docs/api/javax/jms/MessageListener.html
 
They weren't very bright, but they were very, very big. Ad contrast:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic