Mule ESB:checkFrequency不能用于IMAP连接器?

时间:2015-03-04 20:24:04

标签: mule mule-studio

我使用IMAP连接器连接到收件箱并下载邮件。我将checkFrequency参数设置为30000(默认值为60000)。我也尝试过其他价值观。使用下面的确切代码,如果我启动流程,它永远不会自行检查电子邮件。甚至不是第一次开始而不是30秒之后。我可以让它工作的唯一方法是简单地向XML添加一个空格并再次保存它。这会导致连接器连接并下载电子邮件。我错过了什么?

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:spring="http://www.springframework.org/schema/beans"
       xmlns:imap="http://www.mulesoft.org/schema/mule/imap"
       xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
       xmlns:file="http://www.mulesoft.org/schema/mule/file"
       xmlns:email="http://www.mulesoft.org/schema/mule/email"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.6/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.6/mule-file.xsd
http://www.mulesoft.org/schema/mule/imap http://www.mulesoft.org/schema/mule/imap/3.6/mule-imap.xsd
http://www.mulesoft.org/schema/mule/email http://www.mulesoft.org/schema/mule/email/3.6/mule-email.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.6/mule-vm.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd" version="EE-3.6.0">

    <imap:connector name="imapConnector" checkFrequency="30000" doc:name="IMAP" /> 

    <expression-transformer name="returnAttachments" doc:name="Expression">
        <return-argument evaluator="attachments-list" expression="*"/>
    </expression-transformer>

    <file:connector name="fileName" doc:name="File"> 
        <file:expression-filename-parser/> 
    </file:connector>
    <flow name="incoming-orders">
        <imap:inbound-endpoint host="server" port="143" user="user" password="pass" disableTransportTransformer="true" transformer-refs="returnAttachments" doc:name="IMAP" responseTimeout="10000">
        </imap:inbound-endpoint>
        <foreach doc:name="For Each" collection="#[message.inboundAttachments]"  >
            <expression-component doc:name="Expression"><![CDATA[key == "test.xml"]]></expression-component>
            <file:outbound-endpoint path="c:\Mule\in" outputPattern="#[key]" doc:name="File" responseTimeout="10000">
                <expression-transformer> 
                    <return-argument expression="payload.inputStream" evaluator="groovy"/> 
                </expression-transformer>
            </file:outbound-endpoint>
        </foreach>
    </flow>
</mule>

2 个答案:

答案 0 :(得分:0)

将以下属性添加到连接器定义:

mailboxFolder =&#34; INBOX&#34;

答案 1 :(得分:-1)

您创建了一个未使用的imapConnector配置。

将最后一个属性

添加到您的配置中
<imap:inbound-endpoint host="server" port="143" user="user" password="pass" disableTransportTransformer="true" transformer-refs="returnAttachments" doc:name="IMAP" responseTimeout="10000" connector-ref="imapConnector">