Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide

- Previous: About JMS Resources
- Next: To edit a JMS connection factory resource

## To create a JMS connection factory resource

1. In the tree component, expand the Resources node, then expand the JMS Resources node.

2. Select the Connection Factories node.

3. On the JMS Connection Factories page, click New.

   The Create JMS Connection Factory page appears.

4. In the JNDI Name field, type the name of the connection factory.

   It is a recommended practice to use the naming subcontext prefix `jms/` for JMS resources. For example: `jms/ConnectionFactory1`.

5. From the Type drop-down list, choose either `javax.jms.ConnectionFactory`, `javax.jms.QueueConnectionFactory`, or `javax.jms.TopicConnectionFactory`.

6. Select the Enabled checkbox to enable the resource at run time.

7. In the Advanced area, change values as needed for the connection factory attributes.

   For details about these attributes, see To edit a JMS connection factory resource. The Application Server applies these attributes to the connector connection pool created for the connection factory.

8. For a JMS connection factory resource, specify the Transaction Support value as follows:

   - Specify `XATransaction` (the default value) for a resource that can be used for transactions that involve the use of more than one resource within a transaction scope.

     For example, this resource plus a JDBC resource, a connector resource, or another JMS connection factory resource. This value offers the most flexibility. A resource that is configured as `XATransaction` will participate in two-phase commit operations.

   - Specify `LocalTransaction` for a resource that can be used either for transactions that involve only one resource within the transaction scope or as the last agent in a distributed transaction that involves more than one XA resource.

     This value offers significantly better performance. A resource that is configured as `LocalTransaction` will not be used in two-phase commit operations.

   - Specify `NoTransaction` for a resource that can never participate in transactions.

     This setting is of limited use in JMS applications.

9. In the Additional Properties area, provide values for properties required by applications. The following table lists the available properties.

   Property Name | Description
   --- | ---
   `ClientId` | Specifies a client ID for a connection factory that will be used by a durable subscriber.
   `AddressList` | Specifies the names (and, optionally, port numbers) of a message broker instance or instances with which applications will communicate. Each address in the list specifies the host name (and, optionally, host port and connection service) for the connection. For example, the value might be `earth` or `earth:7677`. Specify the port number if the message broker is running on a port other than the default (7676). If the property setting specifies multiple hosts and ports in a clustered environment, the first available host on the list is used unless the `AddressListBehavior` property is set to `RANDOM`. For details, see the Message Queue Developer’s Guide for Java Clients. Default: The local host and default port number (7676). The client will attempt a connection to a broker on port 7676 of the local host.
   `MessageServiceAddressList` | Same as `AddressList`. This property name is deprecated. Use `AddressList` instead.
   `UserName` | The user name for the connection factory. Default: `guest`
   `Password` | The password for the connection factory. Default: `guest`
   `ReconnectEnabled` | If enabled (value = true), specifies that the client runtime attempts to reconnect to a message server (or the list of addresses in the `AddressList`) when a connection is lost. Default: true
   `ReconnectAttempts` | Specifies the number of attempts to connect (or reconnect) for each address in the `AddressList` before the client runtime tries the next address in the list. A value of -1 indicates that the number of reconnect attempts is unlimited (the client runtime attempts to connect to the first address until it succeeds). Default: 3
   `ReconnectInterval` | Specifies the interval in milliseconds between reconnect attempts. This applies for attempts on each address in the `AddressList` and for successive addresses in the list. If the interval is too short, the broker does not have time to recover. If it is too long, the reconnect might represent an unacceptable delay. Default: 30000
   `AddressListBehavior` | Specifies whether connection attempts are in the order of addresses in the `AddressList` attribute (`PRIORITY`) or in a random order (`RANDOM`). `RANDOM` means that the reconnect chooses a random address from the `AddressList`. If many clients are likely to attempt a connection using the same connection factory, this value prevents them from all being connected to the same address. `PRIORITY` means that the reconnect always tries to connect to the first server address in the `AddressList` and uses another address only if the first broker is not available. Default: `RANDOM`
   `AddressListIterations` | Specifies the number of times the client runtime iterates through the `AddressList` in an effort to establish (or reestablish) a connection). A value of -1 indicates that the number of attempts is unlimited. Default: 3

10. In the Targets area, do the following:

    1. From the Available column, select the target or targets to which applications that use the resource will be deployed.

       The available targets include the available clusters and server instances as well as the default server instance, `server`.

    2. Click Add to move the target to the Selected column.

11. Click OK to save the connection factory.

##### Equivalent asadmin command

`create-jms-resource`

- Previous: About JMS Resources
- Next: To edit a JMS connection factory resource

- © 2010, Oracle Corporation and/or its affiliates