This topic describes things to consider when designing an enterprise application to use message-driven beans.
Why and when to perform this task
The considerations in this topic are based on a generic enterprise application that uses one message-driven bean to retrieve messages from a JMS queue destination and passes the messages on to another enterprise bean that implements the business logic.
To design an enterprise application to use message-driven beans, complete the following steps:
Steps for this task
JMS resource type | Properties (for example) |
---|---|
JMS connection factory | Name: SamplePtoPQueueConnectionFactory JNDI Name: Sample/JMS/QCF |
JMS destination | Name: Q1 JNDI Name: Sample/JMS/Q1 |
J2C activation specification properties | Name: MyMDBsActivationSpec JNDI Name: eis/MyMDBsActivationSpec Destination JNDI Name: MyQueue Destination type: javax.jms.Queue |
Message-driven bean (deployment properties) | Name: JMSppSampleMDBBean Transaction type: Container Message selector: JMSType='car' Acknowledge mode: Dups OK Acknowledge Destination type: javax.jms.Queue ActivationSpec JNDI name: MyMDBsActivationSpec |
Business logic bean | Name: MyLogicBean |
Ensure that you use consistent values where needed; for example, the JNDI name for the J2C ActivationSpec must be the same in both the ActivationSpec and the Message-driven bean's deployment properties.
Related concepts
Using message-driven beans to automatically retrieve messages
Related tasks
Developing an enterprise application to use message-driven beans
Deploying an enterprise application to use message-driven beans against
JCA 1.5-compliant resources
Programming to use message-driven beans