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:
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.
Ensure that the server is running.
Remote subcommands require a running server.
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.
(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.
This example creates a queue named PhysicalQueue.
asadmin> create-jmsdest --desttype queue --property User=public:Password=public PhysicalQueue Command create-jmsdest executed successfully. |
You can also view the full syntax and options of the subcommand by typing asadmin help create-jmsdest at the command line.
Use the list-jmsdest subcommand in remote mode to list the existing JMS physical destinations.
Ensure that the server is running.
Remote subcommands require a running server.
List the existing JMS physical destinations by using the list-jmsdest(1) subcommand.
This example lists the physical destinations for the default server instance.
asadmin> list-jmsdest PhysicalQueue queue {} PhysicalTopic topic {} Command list-jmsdest executed successfully. |
You can also view the full syntax and options of the subcommand by typing asadmin help list-jmsdest at the command line.
Use the flush-jmsdest subcommand in remote mode to purge the messages from a physical destination in the specified target's JMS service configuration.
Ensure that the server is running.
Remote subcommands require a running server.
Purge messages from the a JMS physical destination by using the flush-jmsdest(1) subcommand.
(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.
This example purges messages from the queue named PhysicalQueue.
asadmin> flush-jmsdest --desttype queue PhysicalQueue Command flush-jmsdest executed successfully |
You can also view the full syntax and options of the subcommand by typing asadmin help flush-jmsdest at the command line.
Use the delete-jmsdest subcommand in remote mode to remove the specified JMS physical destination.
Ensure that the server is running.
Remote subcommands require a running server.
List the existing JMS physical destinations by using the list-jmsdest(1) subcommand.
Delete the physical resource by using the delete-jmsdest(1) subcommand.
This example deletes the queue named PhysicalQueue.
asadmin> delete-jmsdest --desttype queue PhysicalQueue Command delete-jmsdest executed successfully |
You can also view the full syntax and options of the subcommand by typing asadmin help delete-jmsdest at the command line.