【问题标题】:Error when creating multiple file transfer flows in mule在 mule 中创建多个文件传输流时出错
【发布时间】:2016-05-05 17:04:11
【问题描述】:

我需要三个不同的计划作业来获取文件并将其传输到 SFTP 服务器。使用示例,我能够创建一个工作流程。但是,当我复制该流程并调整配置时,我收到一个错误,抱怨 2 个连接器匹配协议文件。

它要求我指定这些,但是,我已经指定了每个流应该使用哪个端点。

有没有人知道我做错了什么,或者 Mule 正在寻找什么?

流定义:

<file:endpoint name="partsDataConnector" path="${partsDataOriginFilePath}" pollingFrequency="5000" doc:name="partsDataFile"/>

<flow name="partsDataTransfer">

    <quartz:inbound-endpoint jobName="partsDataTransfer"
                             repeatInterval="10000" responseTimeout="10000" doc:name="Quartz">

        <quartz:endpoint-polling-job>
            <quartz:job-endpoint ref="partsDataConnector"/>
        </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>
    <sftp:outbound-endpoint host="${destinationFileServerIp}" port="${destinationFileServerPort}"
                            path="${partsDataDestinationPath}" tempDir="${partsDataDestinationTempDir}"
                            user="${destinationFileServerUser}" password="${destinationFileServerPassword}"
                            outputPattern="#[header:originalFilename]" />
</flow>

<file:endpoint name="imageDataConnector" path="${imageDataOriginFilePath}" pollingFrequency="5000" doc:name="partsDataFile"/>

<flow name="imageDataTransfer">
    <quartz:inbound-endpoint jobName="imageDataTransfer"
                             repeatInterval="10000" responseTimeout="10000" doc:name="Quartz">

        <quartz:endpoint-polling-job>
            <quartz:job-endpoint ref="imageDataConnector"/>
        </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>
    <sftp:outbound-endpoint host="${destinationFileServerIp}" port="${destinationFileServerPort}"
                            path="${imageDataDestinationPath}" tempDir="${imageDataDestinationTempDir}"
                            user="${destinationFileServerUser}" password="${destinationFileServerPassword}"
                            outputPattern="#[header:originalFilename]" />
</flow>

<file:endpoint name="customerDataConnector" path="${customerDataOriginFilePath}" pollingFrequency="5000" doc:name="partsDataFile"/>

<flow name="customerDataTransfer">
    <quartz:inbound-endpoint jobName="customerDataTransfer"
                             repeatInterval="10000" responseTimeout="10000" doc:name="Quartz">

        <quartz:endpoint-polling-job>
            <quartz:job-endpoint ref="customerDataConnector" />
        </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>
    <sftp:outbound-endpoint host="${destinationFileServerIp}" port="${destinationFileServerPort}"
                            path="${customerDataDestinationPath}" tempDir="${customerDataDestinationTempDir}"
                            user="${destinationFileServerUser}" password="${destinationFileServerPassword}"
                            outputPattern="#[header:originalFilename]" />
</flow>

堆栈跟踪:

2014-04-09 06:46:44,924 INFO [org.quartz.core.JobRunShell] Job mule.quartz://customerDataTransfer 抛出了 JobExecutionException: org.quartz.JobExecutionException: org.mule.transport.service.TransportFactoryException: 至少有 2 个连接器匹配协议“文件”,因此必须使用“连接器”属性/属性在端点上指定要使用的连接器。您的配置中支持“文件”的连接器是:connector.file.mule.default、connector.file.mule.default.1、(java.lang.IllegalStateException) [参见嵌套异常:org.mule.transport.service.TransportFactoryException :至少有 2 个连接器匹配协议“文件”,因此必须使用“连接器”属性/属性在端点上指定要使用的连接器。您的配置中支持“文件”的连接器是:connector.file.mule.default, connector.file.mule.default.1, (java.lang.IllegalStateException)] 在 org.mule.transport.quartz.jobs.EndpointPollingJob.doExecute(EndpointPollingJob.java:176) 在 org.mule.transport.quartz.jobs.AbstractJob.execute(AbstractJob.java:36) 在 org.quartz.core.JobRunShell.run(JobRunShell.java:202) 在 org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:534)


【问题讨论】:

  • 您是否在配置中定义了多个文件连接器?因为上面显示的错误提到有两个文件连接器。

标签: mule


【解决方案1】:

错误消息要求您声明明确的file:connector 组件。现在你只有file:endpoint 组件。

【讨论】:

    【解决方案2】:

    如果您还没有定义文件连接器。尝试声明一个并在每个文件端点上添加一个连接器引用。

    <file:connector name="myFileConnector" ></file:connector>
    

    在每个文件端点上添加连接器引用,如下所示。添加所有三个文件端点的引用。

    <file:endpoint name="imageDataConnector"  connector-ref="myFileConnector" path="${imageDataOriginFilePath}" pollingFrequency="5000" doc:name="partsDataFile"/>
    

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-28
      • 2013-11-16
      • 1970-01-01
      • 2016-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-07
      相关资源
      最近更新 更多