Sun GlassFish Enterprise Server v3 Administration Guide

Administering JMS Physical Destinations

Messages are delivered for routing and delivery to consumers by using physical destinations in the JMS provider. A physical destination is identified and encapsulated by an administered object (such as a Topic or Queue destination resource) that an application component uses to specify the destination of messages it is producing and the source of messages it is consuming. For instructions on configuring a destination resource, see To Create a Connection Factory or Destination Resource.

If a message-driven bean is deployed and the physical destination it listens to does not exist, Enterprise Server automatically creates the physical destination and sets the value of the maxNumActiveConsumers property to -1. However, it is good practice to create the physical destination beforehand. The first time that an application accesses a destination resource, Message Queue automatically creates the physical destination specified by the Name property of the destination resource. The physical destination is temporary and expires after a period specified by a Message Queue configuration property.

The following topics are addressed here:

ProcedureTo Create a JMS Physical Destination

For production purposes, always create physical destinations. During the development and testing phase, however, this step is not required. Use the create-jmsdest subcommand in remote mode to create a physical destination.

Because a physical destination 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 Sun GlassFish Message Queue 4.4 Administration Guide.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create a JMS physical destination by using the create-jmsdest(1) subcommand.

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

  3. (Optional) If needed, restart the server.

    Some properties require server restart. See Configuration Changes That Require Server Restart. If your server needs to be restarted, see To Restart a Domain.


Example 19–1 Creating a JMS Physical Destination

This example creates a queue named PhysicalQueue.


asadmin> create-jmsdest --desttype queue --property 
User=public:Password=public PhysicalQueue
Command create-jmsdest executed successfully.

See Also

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

ProcedureTo List JMS Physical Destinations

Use the list-jmsdest subcommand in remote mode to list the existing JMS physical destinations.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List the existing JMS physical destinations by using the list-jmsdest(1) subcommand.


Example 19–2 Listing JMS Physical Destinations

This example lists the physical destinations for the default server instance.


asadmin> list-jmsdest
PhysicalQueue queue {} 
PhysicalTopic topic {}
Command list-jmsdest executed successfully.

See Also

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

ProcedureTo Purge Messages From a Physical Destination

Use the flush-jmsdest subcommand in remote mode to purge the messages from a physical destination in the specified target's JMS service configuration.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Purge messages from the a JMS physical destination by using the flush-jmsdest(1) subcommand.

  3. (Optional) If needed, restart the server.

    Some properties require server restart. See Configuration Changes That Require Server Restart. If your server needs to be restarted, see To Restart a Domain.


Example 19–3 Flushing Messages From a JMS Physical Destination

This example purges messages from the queue named PhysicalQueue.


asadmin> flush-jmsdest --desttype queue PhysicalQueue
Command flush-jmsdest executed successfully

See Also

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

ProcedureTo Delete a JMS Physical Destination

Use the delete-jmsdest subcommand in remote mode to remove the specified JMS physical destination.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. List the existing JMS physical destinations by using the list-jmsdest(1) subcommand.

  3. Delete the physical resource by using the delete-jmsdest(1) subcommand.


Example 19–4 Deleting a Physical Destination

This example deletes the queue named PhysicalQueue.


asadmin> delete-jmsdest --desttype queue PhysicalQueue
Command delete-jmsdest executed successfully

See Also

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