0

Spring 2.5.6 でより多くの jmsTransactionManagers を実装しようとしていますが、うまくいきません。

5 つの異なる環境から読み書きする必要があるため、5 つの接続ファクトリを取得しました。それらはすべてキュー xml Bean にありますが、1 つのキューからメッセージを読み取り、それらがオプションに適合しないため、トランザクション マネージャーでロールバックを行います。

私の質問は、どうすればより多くの JmsTransactionManagers を構成できるかということです。

4

2 に答える 2

1

You'll have to use JTA if you need transactional access to more than one JMS session. In that case, you wouldn't be using JmsTransactionManager at all, you would use a JtaTransactionManager and enlist all those connections in a distributed transaction. This assumes that all of your JMS connections are XA-compatible (often times the connection factory is different, e.g. ActiveMQXAConnectionFactory vs. ActiveMQConnectionFactory).

If you are not using an application server (glassfish, weblogic, jboss AS, etc.), you can deploy a standalone JTA implementation (atomikos or jboss TS). The configuration of each of them differ quite a bit but Spring does support most of them.

于 2011-04-03T07:10:29.877 に答える
-1

connectionFactory の参照をトランザクションマネージャーに追加できます

<bean class="org.springframework.jms.connection.JmsTransactionManager">
    <property name="connectionFactory" ref="connectionFactory1"></property>
</bean>

<bean class="org.springframework.jms.connection.JmsTransactionManager">
    <property name="connectionFactory" ref="connectionFactory2"></property>
</bean>
于 2011-04-03T07:03:03.630 に答える