<!--Arbortext, Inc., 1988-2007, v.4002-->
<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD SolBook 3.5//EN" [
<!ENTITY options-common SYSTEM "options-common.sgm">
<!ENTITY synopsis-common SYSTEM "synopsis-common.sgm">
<!ENTITY % commonents SYSTEM "common.ent">
%commonents;
]>
<?Pub UDT _bookmark _target>
<?Pub CX solbook(>
<refentry id="create-jms-resource-1"><?Pub Tag atict:info tracking="off" ref="2"><?Pub Tag
atict:user user="hl34125" fullname=""><?Pub Tag atict:user user="pmdavies"
fullname=""><?Pub Tag atict:user user="ah95648" fullname="">
<!-- @(#)create-jms-resource.1 1.10 07/07/25 SMI; -->
<refmeta><refentrytitle>create-jms-resource</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="date">30 Jan 2007</refmiscinfo>
<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
<refmiscinfo class="software">&software;</refmiscinfo>
<refmiscinfo class="arch">generic</refmiscinfo>
<refmiscinfo class="copyright">Copyright (c) 2007, Sun Microsystems, Inc.
All Rights Reserved</refmiscinfo>
</refmeta>
<refnamediv><indexterm><primary>create-jms-resource</primary></indexterm>
<indexterm><primary>creates a JMS resource</primary></indexterm>
<refname>create-jms-resource</refname><refpurpose>creates a JMS resource</refpurpose>
</refnamediv>
<refsynopsisdiv><title></title>
<synopsis><command>create-jms-resource</command> &synopsis-common; [<option
role="double-dash">target</option> <replaceable>target</replaceable>]
 <option role="double-dash">restype</option> <replaceable>type</replaceable> [<option
role="double-dash">enabled</option>=<replaceable>true</replaceable>]
 [<option role="double-dash">description</option> <replaceable>text</replaceable>] [<option
role="double-dash">property</option> (<replaceable>name</replaceable>=<replaceable>
value</replaceable>)[:<replaceable>name</replaceable>=<replaceable>value</replaceable>]*]
 <replaceable>jndi_name</replaceable></synopsis>
</refsynopsisdiv>
<refsect1 role="description"><title></title>
<para>The <command>create-jms-resource</command> command creates a Java Message
Service (JMS) connection factory resource or a JMS destination resource. This
command is supported in remote mode only.</para>
</refsect1>
<refsect1 role="options"><title></title>
<variablelist termlength="medium">&options-common;
<varlistentry><term><option role="double-dash">target</option></term>
<listitem><para>This option helps specify the target for which you are creating
the JMS resource. Valid values are:</para>
<itemizedlist>
<listitem><para><literal>server</literal>&hyphen; Specifies the default server
instance as the target for creating the JMS resource. <literal>server</literal> is
the name of the default server instance and is the default value.</para>
</listitem>
<listitem><para><literal>domain</literal>&hyphen; Specifies a certain domain
as the target for creating the JMS resource. </para></listitem>
<listitem><para><replaceable>cluster_name</replaceable>&hyphen; Specifies
a certain cluster as the target for creating the JMS resource. </para>
</listitem>
<listitem><para><replaceable>instance_name</replaceable>&hyphen; Specifies
a certain instance as the target for creating the JMS resource. </para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">restype</option></term>
<listitem><para>The JMS resource type, which can be <filename>javax.jms.Topic</filename>, <filename>
javax.jms.Queue</filename>,<filename>javax.jms.TopicConnectionFactory</filename>,
or <filename>javax.jms.QueueConnectionFactory</filename>.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">enabled</option></term>
<listitem><para>If set to true, the resource is enabled at runtime.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">description</option></term>
<listitem><para>Text providing details of the JMS resource.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">property</option></term>
<listitem><para>Optional attribute name/value pairs for configuring the JMS
resource.</para>
<para>You can specify the following properties for a connection factory resource:
</para>
<variablelist>
<varlistentry><term>ClientId</term>
<listitem><para>Specifies a client ID for a connection factory that will be
used by a durable subscriber.</para>
</listitem>
</varlistentry>
<varlistentry><term>AddressList</term>
<listitem><para>This is a comma-separated list of message queue addresses.
It specifies the names (and, optionally, port numbers) of a message broker
instance or instances with which your application 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 could be <literal>earth</literal> or <literal>
earth:7677</literal>. Specify the port number if the message broker is running
on a port other than the default (7676). If you specify multiple hosts and
ports in a clustered environment, the first available host on the list is
used. Default: An address list composed from the jms-hosts defined in the
target's jms-service configuration. The default for PE is local host and the
default port number is 7676. The client will attempt a connection to a broker
on port 7676 of the local host.</para>
</listitem>
</varlistentry>
<varlistentry><term>MessageServiceAddressList</term>
<listitem><para>Same as <literal>AddressList</literal>. This property name
is deprecated. Use <literal>AddressList</literal> instead.</para>
</listitem>
</varlistentry>
<varlistentry><term>UserName</term>
<listitem><para>The user name for the connection factory. Default: <literal>guest
</literal>.</para>
</listitem>
</varlistentry>
<varlistentry><term>Password</term>
<listitem><para>The password for the connection factory. Default: <literal>guest</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry><term>ReconnectEnabled</term>
<listitem><para>If enabled (value = <literal>true</literal>), it indicates
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: <literal>
false</literal>.</para>
</listitem>
</varlistentry>
<varlistentry><term>ReconnectAttempts</term>
<listitem><para>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: 6.</para>
</listitem>
</varlistentry>
<varlistentry><term>ReconnectInterval</term>
<listitem><para>Specifies the interval in milliseconds between reconnect attempts.
This applies to 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: 30,000 milliseconds.</para>
</listitem>
</varlistentry>
<varlistentry><term>AddressListBehavior</term>
<listitem><para>Specifies whether connection attempts are in the order of
addresses in the AddressList attribute (<literal>PRIORITY</literal>) or in
a random order (<literal>RANDOM</literal>). <literal>PRIORITY</literal> means
that the reconnect will always try to connect to the first server address
in the AddressList and will use another one only if the first broker is not
available. If you have many clients attempting a connection using the same
connection factory, specify <literal>RANDOM</literal> to prevent them from
all being connected to the same address. Default: The <literal>AddressListBehavior
</literal> value of the target<?Pub Caret>'s jms-service configuration.</para>
</listitem>
</varlistentry>
<varlistentry><term>AddressListIterations</term>
<listitem><para>Specifies the number of times the client runtime iterates
through the AddressList in an effort to establish (or re-establish) a connection).
A value of -1 indicates that the number of attempts is unlimited. Default:
-1.</para>
</listitem>
</varlistentry>
</variablelist>
<para>You can specify the following properties for a destination resource:</para>
<variablelist>
<varlistentry><term>Name</term>
<listitem><para>(Required) This property specifies the name of the physical
destination to which the resource will refer. You create a physical destination
with the <command>create-jmsdest</command> command.</para>
</listitem>
</varlistentry>
<varlistentry><term>Description</term>
<listitem><para>This property provides a description of the physical destination.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="operands"><title></title>
<variablelist termlength="medium">
<varlistentry><term><replaceable>jndi_name</replaceable></term>
<listitem><para>The JNDI name of the JMS resource to be created.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="examples"><title></title>
<example><title>Creating a JMS connection factory resource for durable subscriptions
</title>
<para>The following command creates a connection factory resource of type <literal>
javax.jms.TopicConnectionFactory</literal> whose JNDI name is <literal>jms/DurableTopicConnectionFactory
</literal>. The <literal>ClientId</literal> 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 <literal>jms/</literal> naming
subcontext.</para>
<screen>asadmin> <userinput>create-jms-resource --user admin1 
--passwordfile passwords.txt --host pigeon --port 5001 
--restype javax.jms.TopicConnectionFactory --description 
"example of creating a JMS connection factory" 
--property ClientId=MyID jms/DurableTopicConnectionFactory</userinput>
Command create-jms-resource executed successfully.</screen>
</example>
<example><title>Creating a JMS destination resource</title>
<para>The following command creates a destination resource whose JNDI name
is <literal>jms/MyQueue</literal>. The <literal>Name</literal> property specifies
the physical destination to which the resource refers.</para>
<screen>asadmin> <userinput>create-jms-resource --user admin1 
--passwordfile passwords.txt --host pigeon --port 5001 
--restype javax.jms.Queue --property Name=PhysicalQueue jms/MyQueue</userinput>
Command create-jms-resource executed successfully.</screen>
</example>
</refsect1>
<refsect1 role="exit-status"><title></title>
<variablelist termlength="medium">
<varlistentry><term>0</term>
<listitem><para>command executed successfully</para>
</listitem>
</varlistentry>
<varlistentry><term>1</term>
<listitem><para>error in executing the command</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="see-also"><title></title>
<para><olink targetdoc="asrefman" targetptr="delete-jms-resource-1">delete-jms-resource(1)
</olink>, <olink targetdoc="asrefman" targetptr="list-jms-resources-1">list-jms-resources(1)
</olink>, <olink targetdoc="asrefman" targetptr="create-jmsdest-1">create-jmsdest(1)
</olink></para>
</refsect1>
</refentry>
<?Pub *0000010983 0>
