Using TIBCO JMS 2.0 with JBoss EAP Generic JMS RA

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.3

Issue

  • There are two issues when using TIBCO JMS 2.0 with EAP Generic JSM RA:
    • socket leak
    • memory leak

Resolution

In order to be able to use Generic JMS RA with TIBCO JMS 2.0 the following actions have to be followed:

  • upgrade the the laster release of EAP
  • define additional JMS20 configuration property on the factory connection definition
 <connection-definition class-name="org.jboss.resource.adapter.jms.JmsManagedConnectionFactory" jndi-name="java:/jms/tibco/cf/XAQueueConnectionFactory" pool-name="XAQCF">
      <config-property name="JMS20">false</config-property>
      <config-property name="ConnectionFactory">jms/cf/XAQueueConnectionFactory</config-property>
      <config-property name="UserName">${tibco.user}</config-property>
      <config-property name="Password">${tibco.password}</config-property>
      <config-property name="JndiParameters">java.naming.security.principal=${tibco.user};java.naming.security.credentials=${tibco.password};java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory;java.naming.provider.url=tcp://${tibco.host}:${tibco.port}</config-property>
      <xa-pool>
          <min-pool-size>5</min-pool-size>
          <max-pool-size>15</max-pool-size>
      </xa-pool>
      <recovery no-recovery="false">
          <recover-credential>
              <user-name>${tibco.user}</user-name>
              <password>${tibco.password}</password>
          </recover-credential>
      </recovery>
</connection-definition>

The above configuration will create a JMS 1.1 connection factory, that means it will not be able to create JMSContext.
If JMSContext is needed, the following configuration can be used:

<connection-definition class-name="org.jboss.resource.adapter.jms.JmsManagedConnectionFactory" jndi-name="java:/jms/tibco/cf/XAJMSContextConnectionFactory" pool-name="XACCF">
      <config-property name="ConnectionFactory">jms/cf/XAQueueConnectionFactory</config-property>
      <config-property name="UserName">${tibco.user}</config-property>
      <config-property name="Password">${tibco.password}</config-property>
      <config-property name="JndiParameters">java.naming.security.principal=${tibco.user};java.naming.security.credentials=${tibco.password};java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory;java.naming.provider.url=tcp://${tibco.host}:${tibco.port}</config-property>
      <xa-pool>
          <min-pool-size>5</min-pool-size>
          <max-pool-size>15</max-pool-size>
      </xa-pool>
      <recovery no-recovery="false">
          <recover-credential>
             <user-name>${tibco.user}</user-name>
             <password>${tibco.password}</password>
          </recover-credential>
      </recovery>
</connection-definition>

There is an option configuration property SessionDefaultType that can be added to the connection factory definition to specify the resulting connection type i.e. QueueConnection, TopicConnection or JMSContext. For example adding

<config-property name="SessionDefaultType">javax.jms.JMSContext</config-property>

will make the factory only to be able to make JMSContext and not any other JMS connection type.
Possible values for SessionDefaultType are:

  • javax.jms.Queue
  • javax.jms.Topic
  • javax.jms.JMSContext

There is no need to define <config-property name="JMS20">true</config-property> with JMS 2.0 factories since the property defaults to true.

Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.