7.4.3. Create a JMS-based Message-Driven Bean in Red Hat JBoss Developer Studio
- You must have an existing project open in Red Hat JBoss Developer Studio.
- You must know the name and type of the JMS destination that the bean will be listening to.
- Support for Java Messaging Service (JMS) must be enabled in the JBoss EAP 6 configuration to which this bean will be deployed.
Procedure 7.6. Add a JMS-based Message-Driven Bean in Red Hat JBoss Developer Studio
Open the Create EJB 3.x Message-Driven Bean WizardGo to EJB/Message-Driven Bean (EJB 3.x) and click the button.→ → . Select
Figure 7.9. Create EJB 3.x Message-Driven Bean Wizard
Specify class file destination detailsThere are three sets of details to specify for the bean class here: Project, Java class, and message destination.
- If multiple projects exist in the Workspace, ensure that the correct one is selected in the menu.
- The folder where the source file for the new bean will be created is
ejbModuleunder the selected project's directory. Only change this if you have a specific requirement.
- Java class
- The required fields are: Java package and class name.
- It is not necessary to supply a Superclass unless the business logic of your application requires it.
- Message Destination
- These are the details you must supply for a JMS-based Message-Driven Bean:
- Destination name. This is the queue or topic name that contains the messages that the bean will respond to.
- By default the JMS checkbox is selected. Do not change this.
- Set Destination type to Queue or Topic as required.
Enter Message-Driven Bean specific informationThe default values here are suitable for a JMS-based Message-Driven bean using Container-managed transactions.
- Change the Transaction type to Bean if the Bean will use Bean-managed transactions.
- Change the Bean name if a different bean name than the class name is required.
- The JMS Message Listener interface will already be listed. You do not need to add or remove any interfaces unless they are specific to your applications business logic.
- Leave the checkboxes for creating method stubs selected.
onMessage()method. A Red Hat JBoss Developer Studio editor window opened with the corresponding file.