blob: 16591caa807419dc7d935a83ee24def2ba3d51aa [file] [log] [blame]
Title: JmsConnectionFactory Configuration
A JmsConnectionFactory can be declared via xml in the `<tomee-home>/conf/tomee.xml` file or in a `WEB-INF/resources.xml` file using a declaration like the following. All properties in the element body are optional.
<Resource id="myJmsConnectionFactory" type="javax.jms.ConnectionFactory">
connectionMaxIdleTime = 15 Minutes
connectionMaxWaitTime = 5 seconds
poolMaxSize = 10
poolMinSize = 0
resourceAdapter = Default JMS Resource Adapter
transactionSupport = xa
</Resource>
Alternatively, a JmsConnectionFactory can be declared via properties in the `<tomee-home>/conf/system.properties` file or via Java VirtualMachine `-D` properties. The properties can also be used when embedding TomEE via the `javax.ejb.embeddable.EJBContainer` API or `InitialContext`
myJmsConnectionFactory = new://Resource?type=javax.jms.ConnectionFactory
myJmsConnectionFactory.connectionMaxIdleTime = 15 Minutes
myJmsConnectionFactory.connectionMaxWaitTime = 5 seconds
myJmsConnectionFactory.poolMaxSize = 10
myJmsConnectionFactory.poolMinSize = 0
myJmsConnectionFactory.resourceAdapter = Default JMS Resource Adapter
myJmsConnectionFactory.transactionSupport = xa
Properties and xml can be mixed. Properties will override the xml allowing for easy configuration change without the need for ${} style variable substitution. Properties are not case sensitive. If a property is specified that is not supported by the declared JmsConnectionFactory a warning will be logged. If a JmsConnectionFactory is needed by the application and one is not declared, TomEE will create one dynamically using default settings. Multiple JmsConnectionFactory declarations are allowed.
# Supported Properties
<table>
<tr>
<th>Property</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td>connectionMaxIdleTime</td>
<td><a href="configuring-durations.html">time</a></td>
<td>15&nbsp;Minutes</td>
<td>
Maximum amount of time a connection can be idle before being reclaimed
</td>
</tr>
<tr>
<td>connectionMaxWaitTime</td>
<td><a href="configuring-durations.html">time</a></td>
<td>5&nbsp;seconds</td>
<td>
Maximum amount of time to wait for a connection
</td>
</tr>
<tr>
<td>poolMaxSize</td>
<td>int</td>
<td>10</td>
<td>
Maximum number of physical connection to the ActiveMQ broker
</td>
</tr>
<tr>
<td>poolMinSize</td>
<td>int</td>
<td>0</td>
<td>
Minimum number of physical connection to the ActiveMQ broker
</td>
</tr>
<tr>
<td>resourceAdapter</td>
<td>String</td>
<td>Default&nbsp;JMS&nbsp;Resource&nbsp;Adapter</td>
<td>
</td>
</tr>
<tr>
<td>transactionSupport</td>
<td>String</td>
<td>xa</td>
<td>
Specifies if the connection is enrolled in global transaction
allowed values: xa, local or none
</td>
</tr>
</table>