Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

JMS pools configuration

BTM XA connection factories can be created - like their JDBC counterparts - via some java code or via a BTM-specific tool called the Resource Loader. You are free to choose the method you prefer, there is absolutely no difference between them.

Info
titleSupported JMS versions

BTM only supports the JMS 1.1 API. Only servers supporting it can be used with BTM. There is currently no way to make BTM work with JMS 1.0.2 API.

Contents

Table of Contents
maxLevel3
minLevel2

Using the BTM API

BTM comes bundled with a JMS XA connection pool which is very easy to configure. You basically have to create an instance of bitronix.tm.resource.jms.PoolingConnectionFactory set some properties and you're done.

...

Tip
titleNo class implemeting XAConnectionFactory ?

It might be that the XAConnectionFactory class cannot be directly instantiated because the JMS specification only specifies that implementations of this class should only be available from JNDI.
If your vendor only allows XAConnectionFactory implementations to be acquired from JNDI, you should have a look at XA Connection factories only available from JNDI.

Eager initialization

Like for JDBC, the connection pool will be initialized during the first call to createConnection(). It might be desirable to initialize the pool eagerly, like during application startup rather than having to wait for the first request. This can be done by calling init():

...

Now line 7 will initialize the pool and create the 5 connections to the JMS server instead of line 8.

Using the Resource Loader

A connection factory configuration utility is also bundled with BTM. It is convenient to use it rather than create your connection factory in code. Refer to the Resource Loader page for more details.

...