Calling a Message Driven Bean in NetBeans30 July 2007
In previous blog Creating Message Driven Beans in NetBeans we learned about developing a Message Driven Bean in NetBeans IDE. Here we will learn how to call it using features of NetBeans IDE.
- First we will create an empty Java class by selecting New -> Java Class option.
- Fill the package name and other relevant information on the next screen.
- Press “Finish”. Class will be created with some generic code and will be opened in IDE.
- Create a main method in Java class as shown above and Right Click in method and Select Enterprise Resources -> Send JMS Message.
- Code template will be generated in IDE. You need to call the generated method in main method as shown below.
- Press “Shift+F6” or run the program, Message to MDB will be sent.
It will look like this: Calling a Message Driven Bean in NetBeans