aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes What is real life use of MDB EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "What is real life use of MDB EJB" Watch "What is real life use of MDB EJB" New topic
Author

What is real life use of MDB EJB

Dhiren Lodhia
Greenhorn

Joined: Mar 05, 2008
Posts: 14
Hi all,

i just wanted know that where MDBs are used in real life ??
I know that it has to do with deciding synchronous & asynchronous communication ...........

but i could not really understand its real use and advantage in real life.

so can any one please answer following doubts regarding MDB?

1) Why to use MDB?
2) Where to use MDB?
3) what are advantages of using MDB?
4) where exactly MDBs are used in real life?
5) can any one give any simple small demo of proper use of MDB with code?

I will really appreciate if any one can give any simple MDB application demo with code .

Regards,
Dhiren


Dhiren Lodhia
SCJP 5.0 (93%)
Reza Rahman
author
Ranch Hand

Joined: Feb 01, 2005
Posts: 580
    
    5
Dhiren,

I am not sure it is entirely reasonable to expect anyone to explain this in a forum post. Most decent EJB 3.0 references (some of which are free) should answer these questions for you. In short, MDBs are used to process messages (usually JMS messages) in a declarative fashion with minimal infrastructure code in a robust manner. MDBs are typically used in environments where a messaging server like IBM MQ-Series are in use.

Regards,
Reza


Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Alok Kushwah
Ranch Hand

Joined: Jul 10, 2007
Posts: 31
Simple answer to your question is - to implement asynchronous use case.

When ever client of a service don't want to wait for completing of the call is the example of asynchronous case. Queue is used in most of the solutions. Only resposibilty of client is to put one message in the queue. Client can go ahead without worring about how, when, who will process the message.

MDB is always the consumer of that queue. MDB never be called like session or entity bean directly by client. MDB is called by container whenever there is message in the destination queue for the consumpation.

I will give you one simple example. Invetory managment system may have MDB litening to low invetory queue. Order Managmenet system may write to the queue in case inventory for perticular product falling below some level.

You can find examples @ http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/MDB.html
satyajit sethy
Greenhorn

Joined: Jun 23, 2012
Posts: 2
Dhiren Lodhia wrote:Hi all,

i just wanted know that where MDBs are used in real life ??
I know that it has to do with deciding synchronous & asynchronous communication ...........

but i could not really understand its real use and advantage in real life.

so can any one please answer following doubts regarding MDB?

1) Why to use MDB?
2) Where to use MDB?
3) what are advantages of using MDB?
4) where exactly MDBs are used in real life?
5) can any one give any simple small demo of proper use of MDB with code?

I will really appreciate if any one can give any simple MDB application demo with code .

Regards,
Dhiren



1) Why to use MDB? : It is scalable and powerful lightweight mechanism to message communication.
2) Where to use MDB? : when you want to communicate with two heterogeneous system.
3) what are advantages of using MDB? : asynchronous message communication with multithreaded/paralleism(Best of CPU utilisation)
4) where exactly MDBs are used in real life? : where required Old Native system with new system integration.
5) can any one give any simple small demo of proper use of MDB with code? : Check the net you will get lots of stuffs.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Two words, "Guaranteed Delivery".

WP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is real life use of MDB EJB