-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: 4.4.1-fuse-07-11
-
Fix Version/s: 4.4.1-fuse-07-11
-
Component/s: Core
-
Labels:None
In etc/activemq-broker.xml there is an ActiveMQResourceManager configured that is capable of recovering XA transactions after a crash.
However this bean is configured incorrectly.
Rather than
|
activemq-broker.xml |
<bean id="resourceManager" class="org.apache.activemq.pool.ActiveMQResourceManager" init-method="recoverResource">
|
<property name="transactionManager" ref="transactionManager" />
|
<property name="connectionFactory" ref="activemqConnectionFactory" />
|
<property name="resourceName" value="activemq.default" />
|
</bean>
|
|
|
<reference id="transactionManager" interface="javax.transaction.TransactionManager" />
|
it needs to be configured like this
|
activemq-broker.xml |
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
|
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
|
xmlns:amq="http://activemq.apache.org/schema/core"
|
xmlns:blueprint="http://www.osgi.org/xmlns/blueprint/v1.0.0">
|
|
|
[...]
|
|
|
<broker xmlns="http://activemq.apache.org/schema/core" blueprint:id="broker" brokerName="default"
|
dataDirectory="${karaf.data}/activemq/default" useShutdownHook="false">
|
[...]
|
|
|
<bean id="activemqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="broker">
|
<property name="brokerURL" value="vm://default?create=false&waitForStart=10000" />
|
</bean>
|
|
|
|
|
<bean id="resourceManager" class="org.apache.activemq.pool.ActiveMQResourceManager" init-method="recoverResource">
|
<property name="transactionManager" ref="recoverableTxManager" />
|
<property name="connectionFactory" ref="activemqConnectionFactory" />
|
<property name="resourceName" value="activemq.default" />
|
</bean>
|
|
|
<reference id="recoverableTxManager" interface="org.apache.geronimo.transaction.manager.RecoverableTransactionManager" availability="mandatory" />
|
Otherwise TX recovery will not work.
Notice the changes:
- xmlns:blueprint in namespace declaration
- blueprint:id="broker" set on <broker> bean
- depends-on="broker" set on activeMQConnectionFactory bean
- Tx manager imported using different interface
- This new Tx manager set on ResourceManager