• 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 MessageListener

 
Greenhorn
Posts: 10
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to write a listener class which will listen to the messages in queue. but before to tht is it required get the connection to the specified queue? If so how? as to my understanding the listener class is started when the web app is loaded and onMessage() is executed. But where shud i write the code for getting the connection? In my case the queue is already running. i only need to listen to that particular queue for getting the message and process it.

Thanks
mary
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Mary Anu,

I think only message producers need to get connections to the queue. In your case, you're writing a message consumer, and I think you're right. The onMessage() method will be invoked by the container when a message arrives at the queue, and this message will be passed to onMessage() as an argument of type javax.jms.Message.
 
Mary Anu
Greenhorn
Posts: 10
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Henrique Ordine, Thanks for your reply... in that case whr should i specify the queue name which the listener listens to. i have read that configurations are done in web.xml. could you pls explain how it is to be done. my app id running in jboss.

Mary
[ January 17, 2008: Message edited by: Mary Anu ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic