1

我在下面给出了我的骡子配置,我使用骡子 3.4.0。当我的 activemq 出现故障时,ftp 端点读取入站文件并尝试启动 jms 连接器,但出现以下错误。在我重新启动 mule 之前,不会发生 JMS 重新连接。请帮忙。谢谢

INFO 2013-10-09 13:14:53,925 [ActiveMQ 连接执行程序:tcp://localhost/127.0.0.1:61616@43162] org.mule.exception.DefaultSystemExceptionStrategy:捕获的异常是 ConnectException,正在尝试重新连接... INFO 2013-10-09 13:14:53,925 [ActiveMQ 连接执行器:tcp://localhost/127.0.0.1:61616@43162] org.mule.lifecycle.AbstractLifecycleManager:停止连接器:ActiveMQJMSConnector INFO 2013-10-09 13: 14:53,948 [ActiveMQ 连接执行程序:tcp://localhost/127.0.0.1:61616@43780] org.mule.exception.DefaultSystemExceptionStrategy:捕获的异常是 ConnectException,试图重新连接...错误 2013-10-09 13: 14:53,949 [ActiveMQ 连接执行器:tcp://localhost/127.0.0.1:61616@43162] org.mule.exception.DefaultSystemExceptionStrategy:无法启动 Jms 连接错误 2013-10-09 13:14:53,949 [ActiveMQ 连接执行器:tcp://localhost/127.0.0.1:61616@43780] org.mule.exception.DefaultSystemExceptionStrategy:已经在生命周期阶段“停止”,不能两次触发同一阶段

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp"
      xmlns:file="http://www.mulesoft.org/schema/mule/file"
      xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
      xmlns:mule-xml="http://www.mulesoft.org/schema/mule/xml"
      xsi:schemaLocation="
          http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.4/mule-ftp.xsd
          http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.4/mule-file.xsd
          http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.4/mule-jms.xsd
          http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.4/mule.xsd
          http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.4/mule-xml.xsd">
        <mule-xml:namespace-manager includeConfigNamespaces="true"/>
        <ftp:endpoint name="FtpEndpointRecv" host="host1" path="/"
                                  port="21" user="aaa" password="aaa"
                                  pollingFrequency="600000" passive="true" >
        </ftp:endpoint>
        <jms:activemq-connector name="ActiveMQJMSConnector" specification="1.0.2b" brokerURL="tcp://localhost:61616">
                <dispatcher-threading-profile maxThreadsActive="10" maxBufferSize="10" maxThreadsIdle="1" threadTTL="600000" poolExhaustedAction="WAIT" threadWaitTimeout="10000"/>
            <reconnect-forever frequency="5000"/>
    </jms:activemq-connector>
        <file:file-to-string-transformer name="FileToStringTransformer"/>
        <flow name="ftptojms">
                <ftp:inbound-endpoint ref="FtpEndpointRecv" transformer-refs="FileToStringTransformer">
                        <file:filename-wildcard-filter pattern="*.xml"/>
                </ftp:inbound-endpoint>
                <all>
                        <logger level="INFO" message="#['Payload is:'+payload+'\nInbound Headers: '+message.inboundProperties.entrySet()+'\nOutbound Headers: '+message.outboundProperties.entrySet()+'\nExceptions: '+exception]"/>
                        <file:outbound-endpoint responseTimeout="10000" outputPattern="#[message.inboundProperties.originalFilename]" path="/test/msgcopy/"/>
                        <processor-chain>
                                <message-properties-transformer>
                                        <add-message-property key="sourceFile" value="#[message.inboundProperties.originalFilename]"></add-message-property>
                                        <add-message-property key="sourceDir" value="test"></add-message-property>  
                                </message-properties-transformer>
                                <jms:outbound-endpoint queue="testQ" connector-ref="ActiveMQJMSConnector"></jms:outbound-endpoint>
                        </processor-chain>
                </all>
        </flow>
</mule>
4

1 回答 1

0

在发生错误时启动/停止端点不是 Mule 中使用的典型模式。

取而代之的是使用消息处理器until-successful来不断重试jms:outbound-endpoint交互,直到它成功。

于 2013-10-09T18:27:09.660 回答