Adding message destinations
The J2EE 1.4 specification provides a means for J2EE components to refer to message destination objects by using "logical" names called message destination references. You can use the deployment descriptor editors to define message destination references.
Message destinations are elements that specify logical message destinations within an application. The message-destination element defines a message-destination-name, which is used for the purpose of linking. Message destinations can be defined in any module in the J2EE application as the referencing component. A message destination link on a message destination reference or a message-driven bean points to the name of a message destination.
At deployment, the message destination references are bound to the administered message destinations in the target operational environment.
Restriction: Only the following minimum project levels can include message destinations:
- J2EE 1.4 Application Clients
- EJB 2.1 projects
- 2.4 Web Applications
For each message destination that you define, a message-destination element is added to the deployment descriptor for that application component.
The following code shows an example message destination defined in a deployment descriptor:
<message-destination> <description></description> <message-destination-name>MyDest</message-destination-name> </message-destination-ref>To define a message destination, complete the following steps:
- Open the deployment descriptor editor for the module project where you want to add a message destination. To do this, in the Enterprise Explorer of the Java EE perspective, double-click the Deployment Descriptor node for your project.
- In the
Message Destinations section of the editor, click the
Add button. This section is on different pages of the editor depending on the module type:
- Application client projects: Overview page
- Dynamic Web projects: Variables page
- EJB projects: Assembly page
- In the
Name field, specify a name for the message destination. The value entered in the
Name field is used in the message-destination-name element in the deployment descriptor and is the value that could be used by a message destination reference or message-driven bean as its message-destination-link element.
- In the
Description text area, enter a description for the message destination. Click Finish.
- Click Finish.
The message destination is added to the deployment descriptor. Now, when you define message destination references, you can link to this message destination. In the
Message Driven Destinations section of the editor, you can select the message destination and change the name and description. You can also remove the message destination.
Related tasks
Defining references in Java EE modules (J2EE 1.4)
Adding message destination references (J2EE 1.4)