Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Message Driven Bean

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When a message is passed into the onMessage method of a message driven bean at what point is it removed from the queue/topic?
Is it removed when the onMessage method completes or as soon as the method is invoked?

thanks,
 
John R Roberts
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anyone...
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John R Roberts,

Well, we know MDB is always deployed against a particular queue/topic. So when you are sending message to queue and MDB fetch message from that queue then this is where the message gets detached from queue. See if within MDB you get any exception then even in that case we dont have any message left in queue.

I hope this would help you up...

Cheers !!!
Sumit Malik
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Logically, it makes more sense to let the message handler complete before removing the message. To find this out experimentally, you can write a long-running message handler and look into the message queue while this function is running
[ March 30, 2007: Message edited by: Edvins Reisons ]
 
Sumit Malik
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Edvins Reisons,

Good thought !!! Well, I believe that once MDB get message from queue then it(message) gets detached from queue. We must play around with your suggestion

Cheers !!!
Sumit Malik
 
John R Roberts
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the help!!!
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have never worked on EJB's before , nor I know much about these.

Please correct me if I am wrong.

It all depends on the way you configure the MDB in the descriptor.Even it depends on the acknowledgement type that you set.You can configure it to send acknowledgement as soon as the method complets.In case of MDB's configured to durable topics , if the bean encounters exception then another bean is choosen to do the task again.You can even set up the number to times this process should take place before discarding the message totally.
[ March 30, 2007: Message edited by: Rahul Bhattacharjee ]
 
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic