Before we can start writing code to take advantage of the JMS API, we need to configure some GlassFish resources. Specifically, we need to set up a JMS Connection Factory, a message queue, and a message topic.
Note
Java EE 7 and Java EE 8 require all compliant application servers to provide a default JMS connection factory. GlassFish, being a fully compliant Java EE 8 application server (and the Java EE 8 reference implementation), complies with this requirement, so, strictly speaking, we don't really need to set up a connection factory. In many cases we may need to set one up, therefore in the following section, we illustrate how it can be done.
The easiest way to set up a JMS connection factory is via GlassFish's web console. As previously mentioned from, Chapter 1, Introduction to Java EE, that the web console can be accessed by starting our domain by entering the following command on the command line:
asadmin start-domain domain1
We...