I tried to find an example of a config file that would look in a directory once a hour and forward any files on to a component. The documentation on the quartz connector is a bit thin so it wasn't as easy as I expected. Finally I came up this.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesource.org/schema/mule/core/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.0"
xmlns:file="http://www.mulesource.org/schema/mule/file/2.0"
xmlns:ftp="http://www.mulesource.org/schema/mule/ftp/2.0"
xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.0"
xmlns:quartz="http://www.mulesource.org/schema/mule/quartz/2.0"
xmlns:smtp="http://www.mulesource.org/schema/mule/smtp/2.0"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.mulesource.org/schema/mule/core/2.0 http://www.mulesource.org/schema/mule/core/2.0/mule.xsd
http://www.mulesource.org/schema/mule/stdio/2.0 http://www.mulesource.org/schema/mule/stdio/2.0/mule-stdio.xsd
http://www.mulesource.org/schema/mule/vm/2.0 http://www.mulesource.org/schema/mule/vm/2.0/mule-vm.xsd
http://www.mulesource.org/schema/mule/file/2.0 http://www.mulesource.org/schema/mule/file/2.0/mule-file.xsd
http://www.mulesource.org/schema/mule/ftp/2.0 http://www.mulesource.org/schema/mule/ftp/2.0/mule-ftp.xsd
http://www.mulesource.org/schema/mule/quartz/2.0 http://www.mulesource.org/schema/mule/quartz/2.0/mule-quartz.xsd
http://www.mulesource.org/schema/mule/smtp/2.0 http://www.mulesource.org/schema/mule/smtp/2.0/mule-smtp.xsd
">
<file:endpoint name="fileReader" path="/home/ubuntu/inbound"
reverseOrder="false"
pollingFrequency="30000"
comparator=
org.mule.transport.file.comparator.OlderFirstComparator"/>
<stdio:endpoint name="stdio1" system="IN"/>
<model name="testModel">
<service name="Echo">
<inbound>
<quartz:inbound-endpoint jobName="myServiceJob"
cronExpression="0 0 * ? * *">
<quartz:endpoint-polling-job>
<quartz:job-endpoint ref="fileReader" />
</quartz:endpoint-polling-job>
</quartz:inbound-endpoint>
</inbound>
<echo-component />
<outbound>
<outbound-pass-through-router>
<stdio:outbound-endpoint system="OUT" />
</outbound-pass-through-router>
</outbound>
</service>
</model>
</mule>
No comments:
Post a Comment