Generic Resource Adapter for JMS is a J2EE Connector 1.5 resource adapter that can wrap the JMS client library of external JMS providers such as IBM Websphere MQ, Tibco EMS, and Sonic MQ among others, and thus integrate any JMS provider with a J2EE 1.4 application server such as Sun Java System Application Server. The adapter is a.rar archive that can be deployed and configured using a J2EE 1.4 application server's administration tools.
Application server's administration tools can be used to deploy and configure the generic resource adapter for JMS. This section explains how to configure Generic Resource Adapter for JMS with Sun Java System Application Server. Overall, the Resource Adapter can be configured to indicate whether JMS provider supports XA or not. It is also possible to indicate what mode of integration is possible with JMS provider. Two modes of integration are supported by the resource adapter. First one uses JNDI as the means of integration. In this case, administered objects are set up in JMS provider's JNDI tree and will be looked up for use by the generic resource adapter resources. If that mode is not suitable for integration, it is also possible to use Java reflection of JMS administered object javabean classes as the mode of integration. You can use the Sun Java System Application Server's Administration Console or the CLI to configure the resource adapter. This is not different from configuring any other resource adapter.
Prior to deploying the resource adapter JMS client libraries should be made available to the application server. For some JMS providers, client libraries may also include native libraries. In such cases, these native libraries should also be made available to the application server JVM(s).
Deploy the generic resource adapter using the steps in the section To deploy a connector modulein Chapter 2 of this guide. In this case, make sure that you specify install-dir/lib/addons/resourceadapters/genericjmsra/genericra.raras the location of the generic resource adapter. Also, you should specify the properties explained in the section Resource Adapter Properties.
Create a connector connection pool using the steps in the section To create a connector connection pool. In the New Connector Connection Pool page, from the Resource Adapter combo box, select genericra. Also, in the Connection Definition combo box, select javax.jms.QueueConnectionFactory. Additionally, specify the properties explained in the section ManagedConnectionFactory Properties.
Create a connector resource following the steps in the section To create a connector resource. In the New Connector Resource page, select the pool you created in the previous step.
Create an administered object resource using the steps in the section To create an administered object resource. In the New Admin Object Resource page, select genericra as the Resource Adapter and javax.jms.Queue as the Resource Type. Click Next and in the second page, click Add Property. In the Additional Properties table, specify a new property called DestinationProperties with the value Name\\=clientQueue. For information on more properties, see the section Administered Object Resource Properties.
Make the following changes to the security policy in Sun Java System Application Server.
The following table presents the properties to be used while creating the resource adapter.
Property Name |
Valid Values |
Default value |
Description |
---|---|---|---|
ProviderIntegrationMode |
javabean/jndi |
javabean |
Decides the mode of integration between the resource adapter and the JMS client. |
ConnectionFactoryClassName |
Name of the class available in the appserver classpath, for example, com.sun.messaging.ConnectionFactory |
none |
Class name of javax.jms.ConnectionFactory implementation of the jms client. Used if ProviderIntegrationMode is javabean. |
QueueConnectionFactoryClassName |
Name of the class available in the appserver classpath, for example, com.sun.messaging.QueueConnectionFactory |
none |
Class name of javax.jms.QueueConnectionFactory implementation of the jms client. Used if ProviderIntegrationMode is javabean. |
TopicConnectionFactoryClassName |
Name of the class available in the appserver classpath , for example, com.sun.messaging.TopicConnectionFactory |
none |
Class name of javax.jms.TopicConnectionFactory implementation of the jms client. Used if ProviderIntegrationMode is specified as a javabean. |
XAConnectionFactoryClassName |
Name of the class available in appserver classpath , for example, com.sun.messaging.XAConnectionFactory |
none |
Class name of javax.jms.ConnectionFactory implementation of the jms client. Used if ProviderIntegrationMode is specified as a javabean. |
XAQueueConnectionFactoryClassName |
Name of the class available in appserver classpath , for example, com.sun.messaging.XAQueueConnectionFactory |
none |
Class name of javax.jms.XAQueueConnectionFactory implementation of the JMS client. Used if ProviderIntegrationMode is specified as javabean. |
XATopicConnectionFactoryClassName |
Name of the class available in appserver classpath , for example, com.sun.messaging.XATopicConnectionFactory |
NA |
Class name of javax.jms.XATopicConnectionFactory implementation of the JMS client. Used if ProviderIntegrationMode is javabean. |
TopicClassName |
Name of the class available in appserver classpath , for example, com.sun.messaging.Topic |
NA |
Class Name of javax.jms.Topic implementation of the JMS client. Used if ProviderIntegrationMode is javabean. |
QueueClassName |
Name of the class available in appserver classpath , for example, com.sun.messaging.Queue |
NA |
Class Name of javax.jms.Queue implementation of the JMS client. Used if ProviderIntegrationMode is specified as a javabean. |
SupportsXA |
True/false |
FALSE |
Specifies whether the jms client supports XA or not. |
ConnectionFactoryProperties |
Name value pairs separated by comma. |
none |
This specifies the javabean property names and values of the ConnectionFactory of the JMS client. Required only if ProviderIntegrationMode is a javabean. |
JndiProperties |
Name value pairs separated by comma. |
NA |
This specifies the JNDI provider properties to be used for connecting to the JMS provider's JNDI. Used only if ProviderIntegrationMode is jndi. |
CommonSetterMethodName |
Method name |
none |
This specifies the common setter method name some JMS vendors use to set the properties on their administered objects. Used only if ProviderIntegrationMode is javabean. In case of SJSMQ, this value is setProperty |
UserName |
Name of the JMS user |
none |
User name to connect to the JMS Provider. |
Password |
Password for the JMS user. |
none |
Password to connect to the JMS provider. |
RMPolicy |
need info |
ManagedConnectionFactory properties are specified when a connector-connection-pool is created. All the properties specified while creating the resource adapter can be overridden in a ManagedConnectionFactory. Additional properties available only in ManagedConnectionFactory are given below.
Property Name |
Valid Value |
Default Value |
Description |
---|---|---|---|
ClientId |
A valid client ID |
none |
ClientID as specified by JMS 1.1 specification. |
ConnectionFactoryJndiName |
JNDI Name |
none |
JNDI name of the connection factory bound in the JNDI tree of the JMS provider. The administrator should provide all connection factory properties (except clientID) in the JMS provider itself. This property name will be used only if ProviderIntegratinMode is jndi. |
ConnectionValidationEnabled |
true/false |
FALSE |
If set to true, the resource adapter will use an exception listener to catch any connection exception and will send a CONNECTION_ERROR_OCCURED event to application server. |
Properties in this section are specified when an administered object resource is created. All the properties specified in the resource adapter section can be overridden in an administered resource object. Additional properties available only in the administered object resource are given below.
Property Name |
Valid Value |
Default Value |
Description |
---|---|---|---|
DestinationJndiName |
JNDI Name |
none |
JNDI name of the destination bound in the JNDI tree of the JMS provider. Administrator should provide all properties in the JMS provider itself. This property name will be used only if ProviderIntegrationMode is jndi. |
DestinationProperties |
Name value pairs separated by comma |
none |
This specifies the javabean property names and values of the destination of the JMS client. Required only if ProviderIntegrationMode is javabean. |
Properties in this section are specified in the sun specific deployment descriptor of MDB as activation-config-properties. All the properties specified in resource adapter section can be overridden in an ActivationSpec. Additional properties available only in ActivationSpec are given below.
Property Name |
Valid Value |
Default Value |
Description |
---|---|---|---|
MaxPoolSize |
An integer |
8 |
Maximum size of server session pool internally created by resource adapter for achieving concurrent message delivery. This should be equal to maximum pool size of MDB objects. |
MaxWaitTime |
An integer |
3 |
Resource Adapter will wait for the time in seconds specified by this property to obtain a server session from its internal pool. If this limit is exceeded message delivery will fail. |
SubscriptionDurability |
?Durable? or ?Non-Durable? |
?Non-Durable? |
SubscriptionDurability as specified by JMS 1.1 specification. |
SubscriptionName |
NA |
SubscriptionName as specified by JMS 1.1 specification. |
|
MessageSelector |
A valid message selector |
NA |
MessageSelector as specified by JMS 1.1 specification. |
ClientID |
A valid client ID |
NA |
ClientID as specified by JMS 1.1 specification. |
ConnectionFactoryJndiName |
A valid Jndi Name |
NA |
JNDI name of connection factory created in JMS provider. This connection factory will be used by resource adapter to create a connection to receive messages. Used only if ProviderIntegrationMode is configured as jndi. |
DestinationJndiName |
A valid Jndi Name |
NA |
JNDI name of destination created in JMS provider. This destination will be used by resource adapter to create a connection to receive messages from. Used only if ProviderIntegrationMode is configured as jndi. |
DestinationType |
?javax.jms.Queue? or ?javax.jms.Topic? |
javax.jms.Queue) |
Type of the destination the MDB will listen to. |
DestinationProperties |
Name Value Pairs separated by comma |
NA |
This specifies the javabean propery names and values of the Destination of jms client. Required only if ProviderIntegrationMode is javabean. |
RedeliveryAttempts |
integer |
Number of times a message will be redelivered in case a message cause a runtime exception in the MDB. |
|
RedeliveryInterval |
time in seconds |
Interval between repeated deliveries, in case a message causes a runtime exception in the MDB. |
|
SendBadMessagesToDMD |
true/false |
false |
Indicates whether RA should send the messages to a dead message destination, if redelivery attempts is exceeded. |
DeadMessageDestinationJndiName |
a valid JNDI name. |
none |
JNDI name of destination created in JMS provider. Target destination for dead messages. Used only if ProviderIntegrationMode is configured as jndi. |
DeadMessageDestinationClassName |
class name of destination object. |
none |
Used if ProviderIntegrationMode is specified as javabean. |
DeadMessageDestinationProperties |
Name Value Pairs separated by comma |
NA |
This specifies the javabean propery names and values of the Destination of the JMS client. Required only if ProviderIntegrationMode is javabean. |
ReconnectAttempts |
integer |
Number of times a reconnect will be attempted in case exception listener catches an error on connection. |
|
ReconnectInterval |
time in seconds |
interval between reconnects. |