aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Rationale for Message Driven Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Rationale for Message Driven Beans" Watch "Rationale for Message Driven Beans" New topic
Author

Rationale for Message Driven Beans

John Davis
Ranch Hand

Joined: Nov 02, 2000
Posts: 189
What is the rationale for message driven beans? (EJB functionality is available in core J2EE without using JMS).
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
John Davis
Ranch Hand

Joined: Nov 02, 2000
Posts: 189
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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

Joined: Nov 02, 2000
Posts: 189
Lasse,
Thank you for that answer. Now I understand, and for the record, you can never be sufficiently paranoid.
JD
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Here is a tutorial
http://www.theserverside.com/resources/article.jsp?l=Pramati-MDB


Groovy
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
...and for the record, you can never be sufficiently paranoid.

Or can I?
John Davis
Ranch Hand

Joined: Nov 02, 2000
Posts: 189
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rationale for Message Driven Beans