+

Search Tips   |   Advanced Search

Configure JMS destinations

We can configure JMS destinations provided by resource adapters that comply with the Java EE Connector Architecture (JCA) specification.

We can configure one or more instances of JMS destination, queue, or topic types provided by an installed resource adapter.

Configuration elements are provided for the following types of JMS destinations:

To add JCA support for the Liberty profile, we must edit server.xml using either the Source view of the Server configuration editor of the WebSphere Application Server Developer Tools for Eclipse, or some other text editor. Editing portions of the configuration for connection factories, administrative objects, activation specifications, and resource adapters in the Design view is not supported in the Beta.

  1. Configure one or more JMS destination, queue, or topic instances. When we configure the destination instances, supply a properties subelement, even if we do not want to override any configuration properties, to associate the jmsDestination, jmsQueue, or jmsTopic element with a JMS destination interface provided by a particular resource adapter. In the following example, the MyAdapter resource adapter provides only one type of JMS destination, one type of JMS queue, and one type of JMS topic:
    <jmsDestination jndiName="jms/destination1">
     <properties.MyAdapter name="DEST1"/>
    </jmsDestination>
    
    <jmsQueue jndiName="jms/queue1">
     <properties.MyAdapter queueName="QUEUE1"/> 
    </jmsQueue> 
    
    <jmsTopic id="topic1" jndiName="jms/topic1">
     <properties.MyAdapter topicName="TOPIC1"/>
    </jmsTopic>

  2. Optional. If required, identify the available destination, queue, and topic property subelement names.

    This topic assumes that a resource adapter with a unique identifier of MyAdapter has already been configured in the server, see topic Configure resource adapters for further details.

    Limitation: Editing the properties of the resource adapter configuration for connection factories, administrative objects, activation specifications, and resource adapters in the Design view of WebSphere Development Tools (WDT) is not supported.

    • If a resource adapter provides exactly one type of administered object with the javax.jms.Destination interface, the subelement name is: properties.<rar_identifier>

    • If the implementation name is unique without the package name the subelement name is: properties.<rar_identifier>.<ImplementationName>

    • In other cases, the subelement name is: properties.<rar_identifier>.<fully.qualified.InterfaceName>

    • If a resource adapter provides exactly one type of administered object with the javax.jms.Queue interface, the subelement name is: properties.<rar_identifier>

    • If the implementation name is unique without the package name, the subelement name is: properties.<rar_identifier>.<ImplementationName>

    • In other cases, the subelement name is: properties.<rar_identifier>.<fully.qualified.InterfaceName>

    • If a resource adapter provides exactly one type of administered object with the javax.jms.Topic interface, the subelement name is:properties.<rar_identifier>

    • If the implementation name is unique without the package name, the subelement name is: properties.<rar_identifier>.<ImplementationName>

    • In other cases, the subelement name is: properties.<rar_identifier>.<fully.qualified.InterfaceName>


Example

Use the following example to learn how to configure resource adapters with two JMS destinations with unique implementation class names

In the following snippet from a ra.xml file the MyAdapter resource adapter provides two JMS destinations with unique implementation class names:

<adminobject>
<adminobject-interface>javax.jms.Destination</adminobject-interface>
<adminobject-class>com.vendor.adapter.QueueImpl</adminobject-class>
<config-property>
 <config-property-name>queueName</config-property-name>
 <config-property-type>java.lang.String</config-property-type>
</config-property>
 ... 
</adminobject>

<adminobject>
<adminobject-interface>javax.jms.Destination</adminobject-interface>
<adminobject-class>com.vendor.adapter.TopicImpl</adminobject-class> 
<config-property> 
 <config-property-name>topicName</config-property-name> 
 <config-property-type>java.lang.String</config-property-type> 
</config-property> 
...
</adminobject>
The following is an example of a server configuration for this scenario:
<jmsDestination jndiName="jms/destination1">
 <properties.MyAdapter.QueueImpl queueName="D1"/>
</adminObject> 

<jmsDestination jndiName="jms/destination2">
 <properties.MyAdapter.TopicImpl topicName="D2"/> 
</jmsDestination>

Use the following example to learn how to configure resource adapters with two administered objects without implementation class names that are unique.

In the following snippet from a ra.xml file the MyAdapter resource adapter provides two administered objects with non-unique implementation class names:

<adminobject>
<adminobject-interface>javax.jms.Queue</adminobject-interface>
<adminobject-class>com.vendor.adapter.QueueImpl</adminobject-class>
<config-property>
 <config-property-name>queueName</config-property-name>
 <config-property-type>java.lang.String</config-property-type>
</config-property>
... 
</adminobject>

<adminobject>
<adminobject-interface>javax.jms.Queue</adminobject-interface>
<adminobject-class>com.vendor.adapter.advanced.QueueImpl</adminobject-class>
<config-property>
 <config-property-name>name</config-property-name>
 <config-property-type>java.lang.String</config-property-type> 
</config-property>
 ...
</adminobject>
The following is an example of a server configuration for this scenario:
<jmsQueue jndiName="jms/myQueue">
 <properties.MyAdapter.com.vendor.adapter.QueueImpl queueName="Q1"/>
</jmsQueue>

<jmsQueue jndiName="jms/myAdvancedQueue">
 <properties.MyAdapter.com.vendor.adapter.advanced.QueueImpl name="Q1"/>
</jmsQueue>
In some scenarios, lengthy configuration element names might be undesirable. See the information about customizing JCA configuration elements to learn how to override the suffixes of configuration element names.


Parent topic:

Overview of JCA configuration elements