Schedule file proxy to read files at a particular time in wso2

42 Views Asked by At

I need a proxy to be scheduled to start reading files from a folder at only a particular time everyday. But i do have this vfs property set in the proxy as I'm expecting multiple files :-

<parameter name="transport.vfs.FileProcessInterval">60000</parameter>

The scheduled task code is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
<task class="org.apache.synapse.startup.tasks.MessageInjector" group="synapse.simple.quartz" name="Test_Scheduler" xmlns="http://ws.apache.org/ns/synapse">
    <trigger cron="0 0 7 * * ?"/>
    <property name="injectTo" value="proxy" xmlns:task="http://www.wso2.org/products/wso2commons/tasks"/>
    <property name="proxyName" value="TestProxy" xmlns:task="http://www.wso2.org/products/wso2commons/tasks"/>
    <property name="message" xmlns:task="http://www.wso2.org/products/wso2commons/tasks">
        <request xmlns="">
            <operation>Job Scheduler</operation>
        </request>
    </property>
</task>

Right now even if the scheduler is set, the file gets read after the time interval set in the vfs properties. Is there a way i can achieve this schedule for file read?

1

There are 1 best solutions below

0
ycr On

In the Proxy use the File Connector instead of creating a Listener Proxy and have it triggered by the Task.