1

我正在使用独立的 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>

当我在 mule 中运行它并关闭 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>

以下是这两种情况的日志片段: 有事务无事务。在等待两分钟重新连接后,我停止了 mule。

我的问题是:我应该怎么做才能reconnect-forever正常处理交易?

4

1 回答 1

1

我对 Jboss 和 ActiveMQ 都有同样的问题。问题似乎在http://www.mulesoft.org/jira/browse/MULE-6028中得到解决。我检查了它,似乎重新连接适用于版本 3.3.0-RC3。

于 2012-05-21T11:21:29.203 回答