Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rationale for Message Driven Beans

 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the rationale for message driven beans? (EJB functionality is available in core J2EE without using JMS).
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to be able to perform asynchronous processing, session beans and entity beans are of no use. This is where the rationale for MDBs expresses itself.
 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lasse,
But I don't see how that answer explains anything. If the functionality was available synchronously, what would be the rationale for a developer "wishing" to process it asynchronously ?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's say you have a component that is responsible for doing something very CPU intensive or otherwise long-lasting. The component might be forced to call a web service provided by a 3rd party across the globe. Is it feasible to let your end users wait for 10 minutes before a blank browser window? I doubt it -- even if their browsers wouldn't timeout before the 10 minutes... In this kind of situations it's useful to have ways to do things asynchronously -- you're not forced to wait for the response.
 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lasse,
Thank you for that answer. Now I understand, and for the record, you can never be sufficiently paranoid.
JD
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...and for the record, you can never be sufficiently paranoid.

Or can I?
 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lasse,
Probably not.
but to return to the original topic, can you think of way (using a servlet as an EJB client) to obtain a long-running EJB's functionality without JMS/MDB and without requiring an end-user to wait? I hope there is a way because I would like to avoid the additional infrastructure expense involved in providing a transport layer for JMS.
Regards,
JD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic