Sun GlassFish Enterprise Server v3 Administration Guide

ProcedureTo Create a Connection Factory or Destination Resource

For each JMS connection factory that you create, Enterprise Server creates a connector connection pool and connector resource. For each JMS destination that you create, Enterprise Server creates a connector admin object resource. If you delete a JMS resource, Enterprise Server automatically deletes the connector resources.

Use the create-jms-resource command in remote mode to create a JMS connection factory resource or a destination resource.


Tip –

To specify the addresslist property (in the format host:mqport,host2:mqport,host3:mqport) for the asadmin create-jms-resource command, escape the : by using \\. For example, host1\\:mqport,host2\\:mqport,host3\\:mpqport. For more information about using escape characters, see the asadmin(1M) concepts page.


To update a JMS connection factory, use the set subcommand for the underlying connector connection pool, See To Update a Connector Connection Pool.

To update a destination, use the set subcommand for the admin object resource. See To Update an Administered Object.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create a JMS resource by using the create-jms-resource(1) command.

    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–5 Creating a JMS Connection Factory

This example creates a connection factory resource of type javax.jms.ConnectionFactory whose JNDI name is jms/DurableConnectionFactory. The ClientId property sets a client ID on the connection factory so that it can be used for durable subscriptions. The JNDI name for a JMS resource customarily includes the jms/ naming subcontext.


asadmin> create-jms-resource --restype javax.jms.ConnectionFactory
--description "connection factory for durable subscriptions"
--property ClientId=MyID jms/DurableConnectionFactory
Command create-jms-resource executed successfully.


Example 19–6 Creating a JMS Destination

This example creates a destination resource whose JNDI name is jms/MyQueue.


asadmin> create-jms-resource --restype javax.jms.Queue 
--property Name=PhysicalQueue jms/MyQueue
Command create-jms-resource executed successfully.

See Also

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