Ruby
Ruby

Reputation: 378

Scheduling tasks in wso2 Integration Studio

I am trying to schedule a task wherein I want to call a proxy which does not take any input payload. This is the code I've tried:

<?xml version="1.0" encoding="UTF-8"?>
<task class="org.apache.synapse.startup.tasks.MessageInjector" group="synapse.simple.quartz" name="ScheduleOrderCreation" xmlns="http://ws.apache.org/ns/synapse">
  <trigger count="2" interval="5"/>
     <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks" value="" name="message">     
     </property>
     <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks" name="proxyName"  value="CreateOrders"/>
     <property xmlns:task="http://www.wso2.org/products/wso2commons/tasks" name="injectTo" value="proxy"/>   
  </task>

Since I don't want to pass any input payload, I've set value ="" in "message" property. But I get the following error:

  ERROR {MessageInjector} - message or registry-key not set

How can I handle this in my task? Should I write a separate class implementing the Tasks interface to call this proxy?

Upvotes: 0

Views: 390

Answers (1)

ycr
ycr

Reputation: 14604

Just add an Empty Payload there.

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

Upvotes: 1

Related Questions