1 Understanding Message-driven Beans
These are the key features of message-driven beans:
-
Clients do not access message-driven beans through interfaces. A message-driven bean has only a bean class.
-
A message-driven bean's instances retain no data or conversational state for a specific client. All instances of a message-driven bean are equivalent, allowing the EJB container to assign a message to any message-driven bean instance. The container can pool these instances to allow streams of messages to be processed concurrently.
When a message arrives, the container invokes the appropriate message listener method on the MDB. For a JMS MDB, this method is onMessage. The onMessage method may call helper methods, or it may invoke a session or entity bean to process the information in the message or to store it in a database.
For a JMS MDB using container-managed transactions with the Required transaction attribute, message receipt and all transactional work in onMessage that participates in the same transaction are committed or rolled back together. If the transaction is rolled back, the JMS provider's redelivery rules apply. A bean-managed transaction does not include message receipt. See Configuring Transaction Management Strategy for an MDB.
For information about design alternatives for message-driven beans, see MDBs and Messaging Models.
For a description of the overall EJB development process, see Developing Enterprise Beans for Oracle WebLogic Server.
JCA-Based MDBs
resource-adapter-jndi-name element under message-driven-descriptor in weblogic-ejb-jar.xml to identify the resource adapter.See the Jakarta Connectors 2.1 specification and resource-adapter-jndi-name in Developing Enterprise Beans, Version 4.0, for Oracle WebLogic Server.