• Post Reply Bookmark Topic Watch Topic
  • New Topic

MDB over JMS?  RSS feed

 
Luigi Smith
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to understand what the benefits are to using MDBs over session beans with JMS. Anything in the way of performance, etc.?
TIA!
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MDB's are the only way to tie the asynchronous receipt of a message together transactionally with the processing of that message. There's no other way (in or out of MDBs) to do that in Java.
You're really comparing apples and oranges.
Kyle
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at 'Masterting EJB' book by Ed Roman. It has a chapter dedicated towards this issue.
 
Luigi Smith
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah yes, (lightbulb moment)...it's the <b>asynchronicity</b> of the MDB where the real power is at and the fact you can slap on CMT too. Session beans are adept for synchronous transactions.
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A common pattern (well, technique) is to combine MDBs and SLSBs. You use an MDB to accept messages and call a session bean to perform the work. This way if you change your method of message delivery you don't have to move so much code around.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!