Java Reference
In-Depth Information
Notice that most of the body of the generated method to send JMS messages is
enclosed in a try / finally block. Most of the lines inside the try block have the
potential of throwing a JMSException . If this happens, the code attempts to close the
JMS session and connection, which is the exact same thing that needs to be done if the
code ends normally, therefore it makes sense to put this code in the finally block.
Although it is possible to write standalone applications that can retrieve messages
from a messaging destination, most Java EE 5 applications rely on message driven
beans for this task, and NetBeans makes it very easy to generate message
driven beans.
Processing JMS Messages with Message
Driven Beans
In order to create a message driven bean, we need to right-click on our EJB project
and select New | Message Driven Bean . In the resulting dialog window, we need to
enter a name, package, and select a JMS destination for the message driven bean.
 
Search WWH ::




Custom Search