[英]reconnect-forever on JMS endpoint doesn't work with xa-transactions
我正在獨立使用Mule 3.2.1和JBoss 5.1。 這是我的流程:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jbossts="http://www.mulesoft.org/schema/mule/jbossts" xmlns:management="http://www.mulesoft.org/schema/mule/management" version="CE-3.2.1" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jbossts http://www.mulesoft.org/schema/mule/jbossts/current/mule-jbossts.xsd
http://www.mulesoft.org/schema/mule/management http://www.mulesoft.org/schema/mule/management/current/mule-management.xsd ">
<jbossts:transaction-manager/>
<jms:connector name="JMS" specification="1.1" numberOfConsumers="1" jndiInitialFactory="org.jnp.interfaces.NamingContextFactory" jndiProviderUrl="jnp://localhost:1099" connectionFactoryJndiName="java:/XAConnectionFactory" maxRedelivery="10" doc:name="JMS">
<reconnect-forever frequency="5000"/>
</jms:connector>
<flow name="flow" doc:name="flow">
<jms:inbound-endpoint queue="test1" connector-ref="JMS" doc:name="qt1">
<xa-transaction action="BEGIN_OR_JOIN" />
</jms:inbound-endpoint>
<jms:outbound-endpoint queue="test2" connector-ref="JMS" doc:name="qt2">
<xa-transaction action="ALWAYS_JOIN"/>
</jms:outbound-endpoint>
</flow>
當我在m子中運行它並關閉jboss,然后再次將其打開時,我的應用程序不會重新連接到jms。 實際上,它甚至不嘗試! 如果我從流程中刪除事務(如下所示),一切都很好。
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jbossts="http://www.mulesoft.org/schema/mule/jbossts" xmlns:management="http://www.mulesoft.org/schema/mule/management" version="CE-3.2.1" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jbossts http://www.mulesoft.org/schema/mule/jbossts/current/mule-jbossts.xsd
http://www.mulesoft.org/schema/mule/management http://www.mulesoft.org/schema/mule/management/current/mule-management.xsd ">
<jms:connector name="JMS" specification="1.1" numberOfConsumers="1" jndiInitialFactory="org.jnp.interfaces.NamingContextFactory" jndiProviderUrl="jnp://localhost:1099" connectionFactoryJndiName="java:/XAConnectionFactory" maxRedelivery="10" doc:name="JMS">
<reconnect-forever frequency="5000"/>
</jms:connector>
<flow name="flow" doc:name="flow">
<jms:inbound-endpoint queue="test1" connector-ref="JMS" doc:name="qt1">
</jms:inbound-endpoint>
<jms:outbound-endpoint queue="test2" connector-ref="JMS" doc:name="qt2">
</jms:outbound-endpoint>
</flow>
以下是這兩種情況的日志片段: 有事務和無事務 。 等待兩分鍾重新連接后,我停止了m子。
我的問題是:如何使reconnect-forever
與事務正常工作?
我在Jboss和ActiveMQ上都遇到了同樣的問題。 看來問題已在問題http://www.mulesoft.org/jira/browse/MULE-6028中解決。 我檢查了一下,看來重新連接在3.3.0-RC3版本中很好用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.