我有以下Spring Integration
配置。我在这里做的是dequeuing
来自主题的消息,并在转换后将其发送到某个 HTTP 位置。
JMS Connection Factory
配置如下:
<bean id="inboundCF"
class="org.springframework.jms.connection.CachingConnectionFactory">
<constructor-arg index="0">
<jee:jndi-lookup jndi-name="java:comp/resource/ABC_AQ/XATopicConnectionFactories/XATCF" />
</constructor-arg>
<property name="sessionCacheSize" value="3" />
</bean>
<bean id="txInboundCF"
class="org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy">
<property name="targetConnectionFactory" ref="inboundCF" />
<property name="synchedLocalTransactionAllowed" value="true" />
</bean>
并且Message Listener Container
配置如下:
<bean id="jmsInboundContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
destroy-method="destroy">
<property name="connectionFactory" ref="txInboundCF" />
<property name="destination" ref="inboundDestination" />
<property name="pubSubDomain" value="true" />
<property name="sessionTransacted" value="true" />
<property name="errorHandler" ref="errorHandlerService" />
<property name="subscriptionDurable" value="true" />
<property name="durableSubscriptionName" value="mySub" />
<property name="cacheLevel" value="3" />
</bean>
<int-jms:message-driven-channel-adapter channel="jmsInChannel"
container="jmsInboundContainer" acknowledge="transacted" />
并且HTTP outbound adapter
配置如下:
<int-http:outbound-channel-adapter channel="httpOutChannel" url="http://www.example.com/test" http-method="POST" charset="UTF-8" />
在快乐的情况下它工作正常。但是,它不会回滚 http post 消息,而是回滚 jms 消息topic
,以防之后发生任何异常。所以,http:outbound-channel-adapter
是不参与全局事务。
我怎样才能做到这一点。Appricate 在这方面的任何帮助。
其次,我可以在我的日志文件中找到以下日志条目,但消息正在成功出列。
[23/09/2013 14:27:51] WARN [Thread-102] CachingConnectionFactory.onException(301) | Encountered a JMSException - resetting the underlying JMS Connection
javax.jms.JMSException: java.sql.SQLException: ORA-00942: table or view does not exist
at oracle.jms.AQjmsExceptionListener.run(AQjmsExceptionListener.java:222)
[23/09/2013 14:27:51] WARN [jmsInboundContainer-9] DefaultMessageListenerContainer.handleListenerSetupFailure(821) | Setup of JMS message listener invoker failed for destination 'MY_TOPIC' - trying to recover. Cause: JMS-115: Consumer is closed