|
Home TOC Index |
|
Search
Feedback |
deploytool Tips for Message-Driven Beans
Chapter 2 covered the basic steps for building and packaging enterprise beans. This section describes the tasks in
deploytoolthat are necessary for message-driven beans. To view an example indeploytool, open the j2eetutorial/examples/ears/SimpleMessageApp.earfile and selectSimpleMessageEJBfrom the tree view.Specifying the Bean's Type and Transaction Management
You specify the type when you create the bean with the New Enterprise Bean wizard.
- To start the wizard, select File
New
Enterprise Bean.
- In the General dialog box of the wizard, select the Message-Driven radio button.
- In the Transaction Management dialog box, you may select either the Bean-Managed or Container-Managed radio button. If you select the Bean-Managed button, then in step 4 of the next section, you may select the acknowledgment type.
Setting the Message-Driven Bean's Characteristics
You may specify these settings in two places:
- The Message-Driven Bean Settings dialog box of the New Enterprise Bean wizard
- The Message tab of the bean (see Figure 7-2)
These settings are as follows:
- For the Destination Type, select either the Queue or Topic radio button. A queue uses the point-to-point messaging domain and may have at most one consumer. A topic uses the publish-subscribe messaging domain; it may have zero, one, or many consumers.
- In the Destination combo box, select the JNDI name of the destination that you have created administratively. For an example, see the section Creating the Queue. The destination is either a
Queueor aTopicobject; it represents the source of incoming messages and the target of outgoing messages.- In the Connection Factory combo box, select the appropriate object, either a
QueueConnectionFactoryor aTopicConnectionFactory. These objects produce the connections through which J2EE components access the messaging service.- If you've specified bean-managed transactions, then you may select the acknowledgment type--either Auto-Acknowledge or Duplicates-OK-- from the Acknowledgement combo box. The Auto-Acknowledge type instructs the session to automatically acknowledge that the bean has consumed the message. The Duplicates-OK type instructs the session to lazily acknowledge the delivery of messages; this type may result in duplicate messages, but it reduces session overhead.
- In the JMS Message Selector field, you may enter a statement that filters the messages received by the bean.
|
Home TOC Index |
|
Search
Feedback |