The primary reason for us to configure JMS resources on the application server is for applications and services deployed on the server, to get access to these resources in a vendor-independent way. In this section, we will see how we can use the JMS resources in an application to send or receive messages. Applications can either use JMS resources that are deployed on the application server, or they can use JMS resources that are defined at the application level.
We have provided two sample applications that demonstrate the use of JMS resources in an application, namely, JMS Sample and JMS Sample ear. In both of these cases, the Java code and functionality will be the same. The only difference will be in the deployment descriptors. Both of these applications send messages to a topic and have the same codebase, but one of them defines the JMS resources used at the client scope, while the other uses server-scoped resources. The code is the same for both...