Sun GlassFish Enterprise Server v2.1.1 High Availability Administration Guide

Configuring the Java Message Service

The Java Message Service configuration is available to all inbound and outbound connections to the Sun GlassFish Enterprise Server cluster or instance. You can configure the Java Message Service with:

You can override the Java Message Service configuration using JMS connection factory settings. For details, see JMS Connection Factories in Sun GlassFish Enterprise Server v2.1.1 Administration Guide.


Note –

You must restart the Enterprise Server instance after changing the configuration of the Java Message Service.


For more information about JMS administration, see Chapter 4, Configuring Java Message Service Resources, in Sun GlassFish Enterprise Server v2.1.1 Administration Guide

Java Message Service Integration

MQ can be integrated with Enterprise Server in three ways: LOCAL, REMOTE, and EMBEDDED. These modes are represented in the Admin Console by the Java Message Service Type attribute.

LOCAL Java Message Service

When the Type attribute is LOCAL (the default for cluster instances), the Enterprise Server will start and stop the MQ broker specified as the Default JMS host. The MQ process is started out-of-process, in a separate VM, from the appliciation server process. Enterprise Server supplies an additional port to the broker . This port will be used by the broker to start the RMI registry. This port number will be equal to the configured JMS port for that instance plus 100. For example, if the JMS port number is 37676, then this additional port number will be 37776.

To create a one-to-one relationship between Enterprise Server instances and Message Queue brokers, set the type to LOCAL and give each Enterprise Server instance a different default JMS host. You can do this regardless of whether clusters are defined in the Enterprise Server or MQ.

With LOCAL type, use the Start Arguments attribute to specify MQ broker startup parameters.

REMOTE Java Message Service

When the Type attribute is REMOTE, the MQ broker must be started separately. For information about starting the broker, see the Sun GlassFish Message Queue Administration Guide.

In this case, Enterprise Server will use an externally configured broker or broker cluster. Also, you must start and stop MQ brokers separately from Enterprise Server, and use MQ tools to configure and tune the broker or broker cluster. REMOTE type is most suitable for Enterprise Server clusters.

With REMOTE type, you must specify MQ broker startup parameters using MQ tools. The Start Arguments attribute is ignored.

EMBEDDED Java Message Service

When the JMS Type attribute is EMBEDDED, it means that the Enterprise Server and the JMS broker are co-located in the same VM and the JMS service is started in-process and managed by the Enterprise Server. In this mode, the JMS operations by pass the networking stack leading to performance optimization.

JMS Hosts List

A JMS host represents an MQ broker. The Java Message Service contains a JMS Hosts list (also called AddressList) that contains all the JMS hosts that Enterprise Server uses.

The JMS Hosts list is populated with the hosts and ports of the specified MQ brokers and is updated whenever a JMS host configuration changes. When you create JMS resources or deploy MDBs, they inherit the JMS Hosts list.


Note –

In the Sun GlassFish Message Queue software, the AddressList property is called imqAddressList.


Default JMS Host

One of the hosts in the JMS Hosts list is designated the default JMS host, named Default_JMS_host. The Enterprise Server instance starts the default JMS host when the Java Message Service type is configured as LOCAL.

If you have created a multi-broker cluster in the Sun GlassFish Message Queue software, delete the default JMS host, then add the Message Queue cluster’s brokers as JMS hosts. In this case, the default JMS host becomes the first one in the JMS Hosts list.

When the Enterprise Server uses a Message Queue cluster, it executes Message Queue specific commands on the default JMS host. For example, when a physical destination is created for a Message Queue cluster of three brokers, the command to create the physical destination is executed on the default JMS host, but the physical destination is used by all three brokers in the cluster.

Creating JMS Hosts

You can create additional JMS hosts in the following ways: