Message Driven Bean MDB - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Message Driven Bean MDB

Description:

EJB Container. JMS Service Illustrated. Client Application. 4. ... EJB container provides all the plumbing necessary for MDBs to process messages concurrently. ... – PowerPoint PPT presentation

Number of Views:291
Avg rating:3.0/5.0
Slides: 7
Provided by: Bra59
Category:

less

Transcript and Presenter's Notes

Title: Message Driven Bean MDB


1
Message Driven Bean (MDB)
  • Group 4

2
What is MDB?
  • Message Driven Beans are EJB components that
    listen for message published on a JMS server.
  • EJB 2.0 specification introduces a new kind of
    EJB called the MDB.
  • The MDB model is designed to enable an EJB to be
    asynchronously invoked to handle the processing
    of incoming JMS messages.
  • Message driven beans are a combination of Session
    beans and JMS clients.  

3
Messaging Systems MDB
  • Message driven beans are enterprise beans that
    act as message consumers in the messaging system.
  • MDB dont have a remote or a home interface.
  • They are designed to interact with JMS API.
  • MDB is used to integrate with the JMS, a service
    that allows clients to give orders to your EJB
    components without hanging around waiting for a
    response.
  • Client applications access a message driven bean
    through JMS by sending messages to the JMS
    destination.

4
JMS Service Illustrated
1. Client application opens a connection to a
JMS topic or queue
2. MDB registers a listener for a JMS topic or
queue
Java Messaging Service
JMS Topic
Client Application
4. The JMS topic or queue forwards the message
to the MDB, which takes action based on the
content of the message.
JMS Connection
EJB Container
ltlttopic listenergtgt message-driven bean
3. Client sends a message to the JMS topic or
queue. Once message is delivered, the client is
free to continue with other actions.
5
MDB Vs. Beans
  • A session bean provides a remote interface that
    defines which methods can be invoked, a MDB
    doesnt.
  • MDB doesnt use any of the component interfaces,
    because it is never accessed by method calls from
    other applications or beans.

6
Pros Cons of MDB
  • Pros
  • EJB container provides all the plumbing necessary
    for MDBs to process messages concurrently. The
    result is multithreading environment that
    provides a substantial improvement in
    performance.
  • Cons
  • Not synchronous.
  • MDBs are stateless, so if you need to preserve
    state between method invocations, you must use
    stateful session beans.
Write a Comment
User Comments (0)
About PowerShow.com