我已经给出了下面的mule配置,我使用mule 3.4.0。当我的activemq关闭时,ftp端点读取入站文件并尝试启动jms连接器,我得到了以下错误。 JMS重新连接不会发生,直到我重新启动mule。请帮忙。感谢
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>
答案 0 :(得分:0)
出现错误时启动/停止端点,不是Mule中使用的典型模式。
而是使用until-successful
之类的消息处理器继续重试jms:outbound-endpoint
交互,直到成功为止。