Produced messages are delivered for routing and subsequent delivery to consumers using physical destinations in the JMS provider. A physical destination is identified and encapsulated by an administered object (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.
If a message-driven bean is deployed and the Queue physical destination it listens to doesn’t exist, the Enterprise Server automatically creates the physical destination and sets the value of the property maxNumActiveConsumers to -1 (see Load-Balanced Message Inflow). However, it is good practice to create the Queue physical destination beforehand.
You can create a JMS physical destination in the following ways:
Use the Admin Console. Open the Resources component, open the JMS Resources component, then select Physical Destinations. For details, click the Help button in the Admin Console.
Use the asadmin create-jmsdest command. This command acts on the default JMS host of its target. For details, see the Sun GlassFish Enterprise Server 2.1 Reference Manual.
To purge all messages currently queued at a physical destination, use the asadmin flush-jmsdest command. This deletes the messages before they reach any message consumers. For details, see the Sun GlassFish Enterprise Server 2.1 Reference Manual.
To create a destination resource, see Creating JMS Resources: Destinations and Connection Factories.