• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is real life use of MDB EJB

 
Dhiren Lodhia
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Alok Kushwah
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two words, "Guaranteed Delivery".

WP
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic