Wednesday, February 9, 2011

Messaging - What is Message Driven Bean?

What exactly is Message Driven Bean (MDB)
  1. From the perspective of Java artefact, it is an EJB specified by EJB 2.1. It is a stateless session bean.
  2. It is a consumer in terms of the messaging programming model.
  3. It implements javax.ejb.MessageDrivenBean (container life-cycle management).
  4. It implements javax.jms.MessageListener interface.
  5. It implements ejbCreate() method.
  6. The EJB container maintains a pool of method-ready MDB.
  7. When a message comes, the container selects a MDB from the pool to process the message.
  8. The container removes an MDB by invoking ejbRemove() method.
  9. The transaction can be container managed or bean managed.
  10. To associate an MDB with destination on SIB, use JMS activation specification.
  11. To associate an MDB with a destination on MQ, use listener port.


No comments: