Configuring GlassFish
We have installed the GlassFish server. Let's now take a look at how to initialize our JMS provider, before we actually write some code to send and receive messages.
First, we define some resources in the GlassFish server, which are called administered objects. These have names, which we can use to access the resources in our application code. The first admin object is connectionFactory. By default, the server has a connectionFactory called __defaultConnectionFactory. This is used for bootstrapping in the messaging model. We can use a Java Naming and Directory Interface (JNDI) lookup by passing the name of the factory. This gives an object in return, which represents the ConnectionFactory.
We then use the connectionFactory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access