Oracle GlassFish Server 3.0.1 Administration Guide

Administering JMS Hosts

A JMS host represents a Message Queue broker. JMS contains a JMS hosts list (the AddressList property) that contains all the JMS hosts that are used by GlassFish Server. The JMS hosts list is populated with the hosts and ports of the specified Message Queue brokers and is updated whenever a JMS host configuration changes. When you create JMS resources or deploy message driven beans, the resources or beans inherit the JMS hosts list.

One of the hosts in the JMS hosts list is designated the default JMS host. GlassFish Server starts the default JMS host when the Message Queue broker mode is configured as type LOCAL.

The following topics are addressed here:

ProcedureTo Create a JMS Host

A default JMS host, default_JMS_host, is provided by GlassFish Server. The default JMS host is used by GlassFish Server to perform all Message Queue broker administrative operations, such as creating and deleting JMS destinations.

Creating a new JMS host is not often necessary and is a task for advanced users. Use the create-jms-host subcommand in remote mode to create an additional JMS host.

Because a JMS is actually a Message Queue object rather than a server object, you use Message Queue broker commands to update properties. For information on Message Queue properties, see Oracle GlassFish Message Queue 4.4.2 Administration Guide.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create the JMS host by using the create-jms-host(1) subcommand.

    Information about the properties for this the subcommand is included in this help page.


Example 19–10 Creating a JMS Host

This example creates a JMS host named MyNewHost.


asadmin> create-jms-host --mqhost pigeon --mqport 7677 MyNewHost
Command create-jms-host executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-jms-host at the command line.

ProcedureTo List JMS Hosts

Use the list-jms-hosts subcommand in remote mode to list the existing JMS hosts.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List the JMS hosts by using the list-jms-hosts(1) subcommand.


Example 19–11 Listing JMS Hosts

The following subcommand lists the existing JMS hosts.


asadmin> list-jms-hosts
default_JMS_host
MyNewHost
Command list-jmsdest executed successfully

ProcedureTo Update a JMS Host

  1. List the JMS hosts by using the list-jms-hosts(1) subcommand.

  2. Use the set(1) subcommand to modify a JMS host.


Example 19–12 Updating a JMS Host

This example changes the value of the host attribute of the default JMS host. By default this value is localhost.


asadmin>  set server-config.jms-service.jms-host.default_JMS_host.host=
"archie.india.sun.com"

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help set at the command line.

ProcedureTo Delete a JMS Host

Use the delete-jms-host subcommand in remote mode to delete a JMS host from the JMS service. If you delete the only JMS host, you will not be able to start the Message Queue broker until you create a new JMS host.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List the JMS hosts by using the list-jms-hosts(1) subcommand.

  3. Delete a JMS host by using the delete-jms-host(1) subcommand.


Example 19–13 Deleting a JMS Host

This example deletes a JMS host named MyNewHost.


asadmin> delete-jms-host MyNewHost
Command delete-jms-host executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help delete-jms-host at the command line.