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?
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>
Related
I'm trying to use WS02 ESB 5.0 to call a web service every 15 seconds, so I have this task:
<?xml version="1.0" encoding="UTF-8"?>
<task class="org.apache.synapse.startup.tasks.MessageInjector"
group="synapse.simple.quartz" name="UpdateName" xmlns="http://ws.apache.org/ns/synapse">
<trigger cron="0/15 * * * * ?" />
<property name="message"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks">
<def:login soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:def="http://DefaultNamespace" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xsi:type="xsd:string">usr</id>
<pw xsi:type="xsd:string">pwd</pw>
</def:login>
</property>
<property name="sequenceName" value="main"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks" />
<property name="injectTo" value="sequence"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks" />
</task>
And this sequence:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="main" xmlns="http://ws.apache.org/ns/synapse">
<in>
<send>
<endpoint>
<wsdl port="SakaiLogin" service="SakaiLoginService" trace="disable"
uri="http://myserver/sakai-axis/SakaiLogin.jws?wsdl" />
</endpoint>
</send>
</in>
<out>
<send />
</out>
<log level="full" />
</sequence>
Both from the examples shown in the documentation:
https://docs.wso2.com/display/ESB500/Adding+and+Scheduling+Tasks (See "Injecting the message to a named sequence or proxy service").
https://docs.wso2.com/display/ESB500/Sample+56:+Using+a+WSDL+Endpoint+as+the+Target+Endpoint (See "Building the sample").
However, I'm getting this error once I start the Carbon WSO2 ESB server:
[2017-01-27 17:03:45,005] ERROR - InMediator Runtime error occurred while mediating the message
java.lang.NullPointerException
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.isTransportSwitching(Axis2SynapseEnvironment.java:783)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:545)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:382)
at org.apache.synapse.endpoints.WSDLEndpoint.send(WSDLEndpoint.java:75)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:121)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:74)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.mediators.MediatorWorker.run(MediatorWorker.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[2017-01-27 17:03:45,023] INFO - LogMediator To: ,
MessageID: urn:uuid:097fb69e-6461-428e-ac85-93cfde65d02e,
Direction: request,
MESSAGE = Executing default 'fault' sequence,
ERROR_CODE = 0,
ERROR_MESSAGE = Runtime error occurred while mediating the message, Envelope:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<def:login xmlns:def="http://DefaultNamespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<id xmlns="http://ws.apache.org/ns/synapse" xsi:type="xsd:string">usr</id>
<pw xmlns="http://ws.apache.org/ns/synapse" xsi:type="xsd:string">pwd</pw>
</def:login></soapenv:Body></soapenv:Envelope>
Can anybody give me a clue of what is going on?
Much appreciated!
In the wsdl endpoint the uri value must be the WSDL address, not the service endpoint:
WSDL URI The URI of the WSDL. Click Test to test the URI.
So, the WSDL endpoint inside the send mediator extracts the service endpoint from the WSDL document using the service and port name to find it inside the wsdl document.
UPDATE 1:
My task config xml:
<?xml version="1.0" encoding="UTF-8"?>
<task xmlns="http://ws.apache.org/ns/synapse"
name="UpdateName"
class="org.apache.synapse.startup.tasks.MessageInjector"
group="synapse.simple.quartz">
<trigger cron="0/15 * * * * ?"/>
<property name="proxyName" value="testTask"/>
<property name="message">
<moc:QRY_SELECT_SRH_EMPLEADO xmlns:moc="http://www.example.org/mockWS/">
<INT_ID>gero et</INT_ID>
</moc:QRY_SELECT_SRH_EMPLEADO>
</property>
<property name="soapAction"
value="http://www.example.org/mockWS/QRY_SELECT_SRH_EMPLEADO"/>
<property name="injectTo" value="proxy"/>
</task>
My sequence named main1:
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="main1">
<in>
<header name="Action" scope="default" value="http://www.example.org/mockWS/QRY_SELECT_SRH_EMPLEADO"/>
<send>
<endpoint>
<wsdl service="mockWS"
port="mockWSSOAP"
uri="http://localhost:8088/mockmockWSSOAP?wsdl"/>
</endpoint>
</send>
</in>
<out>
<log level="full"/>
<drop/>
</out>
</sequence>
And finally I created a proxy with the same logic because a issue with the drop mediator inside a sequence:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="testTask"
transports="https http"
startOnLoad="true">
<target>
<inSequence>
<header name="Action" scope="default" value="http://www.example.org/mockWS/QRY_SELECT_SRH_EMPLEADO"/>
<send>
<endpoint>
<wsdl service="mockWS"
port="mockWSSOAP"
uri="http://localhost:8088/mockmockWSSOAP?wsdl"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<drop/>
</outSequence>
<faultSequence/>
</target>
</proxy>
I am trying to connect a WSO2 CEP server to a WSO2 Message Broker server.
I have created a jndi.properties file:
connectionfactory.TopicConnectionFactory = amqp://admin:admin#clientid/carbon?brokerlist='tcp://192.168.11.2:5673'
topic.testTopic = testTopic
an input event adaptor:
<?xml version="1.0" encoding="UTF-8"?>
<inputEventAdaptor name="MBJMSInputAdaptor" statistics="enable"
trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
<property name="java.naming.provider.url">repository/conf/jndi.properties</property>
<property name="transport.jms.SubscriptionDurable">false</property>
<property name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</property>
<property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
<property name="transport.jms.DestinationType">topic</property>
</inputEventAdaptor>
a stream definition:
<streamDefinitions xmlns="http://wso2.org/carbon/databridge">
<streamDefinition>
{
"name":"testStream",
"version":"1.0.0",
"payloadData":[
{"name":"id","type":"INT"},
{"name":"name","type":"STRING"}
]
}
</streamDefinition>
</streamDefinitions>
and an event builder:
<?xml version="1.0" encoding="UTF-8"?>
<eventBuilder name="testBuilder" statistics="enable" trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
<from eventAdaptorName="MBJMSInputAdaptor" eventAdaptorType="jms">
<property name="topic">testTopic</property>
</from>
<mapping customMapping="enable" type="json">
<property>
<from jsonPath="id"/>
<to name="id" type="int"/>
</property>
<property>
<from jsonPath="name"/>
<to name="name" type="string"/>
</property>
</mapping>
<to streamName="testStream" version="1.0.0"/>
</eventBuilder>
Unfortunately, the WSO2 CEP server does not receive messages from the WSO2 Message Broker server, and throws the following exception:
[2014-11-28 13:00:00,226] INFO - {JMSEventAdaptorType} JMS input event adaptor loading listeners
Exception in thread "Thread-29" java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988)
at org.wso2.carbon.event.input.adaptor.jms.JMSEventAdaptorType.createJMSAdaptorListener(JMSEventAdaptorType.java:291)
at org.wso2.carbon.event.input.adaptor.jms.JMSEventAdaptorType.tryStartAdaptor(JMSEventAdaptorType.java:262)
at org.wso2.carbon.event.input.adaptor.jms.internal.ds.JMSEventAdaptorServiceHolder.loadLateStartEventAdaptors(JMSEventAdaptorServiceHolder.java:66)
at org.wso2.carbon.event.input.adaptor.jms.internal.ds.JMSEventAdaptorServiceHolder$1.run(JMSEventAdaptorServiceHolder.java:43)
at java.lang.Thread.run(Thread.java:745)
Could you help me debugging this exception?
If you like to debug the code then you can checkout the source from below location [1].. But I think below blog [2] will help you to achieve the usecase.
[1]https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/event-stream/event-input-adaptor/org.wso2.carbon.event.input.adaptor.jms/1.0.1
[2] http://sajithr.blogspot.com/2014/04/sample-on-using-wso2-mb-with-wso2-cep.html
i am using wso2cep 3.0.0 and activemq5.8.0
As per CEP documents i wish to Publish events using CEP.
For that i started activemq with 2 define QUEUES with the name jmsProxy for incoming message and JmsProxy for out message.I added required jars in CEP lib activemq-broker-5.8.0.jar,activemq-client-5.8.0.jar,axiom.jar,geronimo-j2ee-management_1.1_spec-1.0.1.jar,geronimo-jms_1.1_spec-1.1.1.jar,hawtbuf-1.2.jar,xpp3-1.1.4c.jar,xstream-1.4.4.jar
my configuration is like this
InputEventAdaptor
<?xml version="1.0" encoding="UTF-8"?>
<inputEventAdaptor name="jmsProxy" statistics="disable" trace="enable"
type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
<property name="java.naming.provider.url">tcp://localhost:61616</property>
<property name="transport.jms.SubscriptionDurable">true</property>
<property name="transport.jms.DurableSubscriberName">jmsProxy</property>
<property name="transport.jms.UserName">admin</property>
<property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
<property name="transport.jms.Password">admin</property>
<property name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</property>
<property name="transport.jms.DestinationType">queue</property>
</inputEventAdaptor>
above for incoming messages which will pick the messages from jmsProxy queue
But its unable to pick the message from jmsProxy Queue.How would i initiate this to get the message into CEP and
outputEventAdaptor
<?xml version="1.0" encoding="UTF-8"?>
<outputEventAdaptor name="JmsProxy" statistics="disable" trace="disable"
type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
<property name="java.naming.security.principal">admin</property>
<property name="java.naming.provider.url">tcp://localhost:61616</property>
<property name="java.naming.security.credentials">admin</property>
<property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
<property name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</property>
<property name="transport.jms.DestinationType">queue</property>
</outputEventAdaptor>
event builder configuration like this
<?xml version="1.0" encoding="UTF-8"?>
<eventBuilder name="ReadingsDtoBuilder" statistics="disable"
trace="disable" xmlns="http://wso2.org/carbon/eventbuilder">
<from eventAdaptorName="jmsProxy" eventAdaptorType="jmsProxy">
<property name="transport.jms.Destination">JmsProxy</property>
</from>
<mapping customMapping="disable"
parentXpath="//ReadingsLiteTaildtos" type="xml">
<property>
<from xpath="//ReadingsLiteTaildto/ParameterId"/>
<to name="meta_parameterId" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/Slno"/>
<to name="meta_slno" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/FinalValue"/>
<to name="finalValue" type="int"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/InputText"/>
<to name="inputText" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/InputValue"/>
<to name="inputValue" type="double"/>
</property>
</mapping>
<to streamName="org.sample.readings.dto.stream" version="1.0.0"/>
</eventBuilder>
The execution plan can be as follows.like this
<?xml version="1.0" encoding="UTF-8"?>
<executionPlan name="ReadingsAnalyzer" statistics="disable"
trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
<description>This execution plan analyzes readings and triggers notifications based on threshold.</description>
<siddhiConfiguration>
<property name="siddhi.enable.distributed.processing">false</property>
<property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
</siddhiConfiguration>
<importedStreams>
<stream as="readings" name="org.sample.readings.dto.stream" version="1.0.0"/>
</importedStreams>
<queryExpressions><![CDATA[from readings[finalValue > 100]
select *
insert into notificationStream;]]></queryExpressions>
<exportedStreams>
<stream name="notificationStream" valueOf="notificationStream" version="1.0.0"/>
</exportedStreams>
</executionPlan>
I defined streams inside stream-manager-config.xml similar to the following.
<streamDefinition name="org.sample.readings.dto.stream" version="1.0.0">
<metaData>
<property name="parameterId" type="STRING"/>
<property name="slno" type="STRING"/>
</metaData>
<payloadData>
<property name="finalValue" type="INT"/>
<property name="inputText" type="STRING"/>
<property name="inputValue" type="DOUBLE"/>
</payloadData>
</streamDefinition>
<streamDefinition name="notificationStream" version="1.0.0">
<metaData>
<property name="parameterId" type="STRING"/>
<property name="slno" type="STRING"/>
</metaData>
<payloadData>
<property name="finalValue" type="INT"/>
<property name="inputText" type="STRING"/>
<property name="inputValue" type="DOUBLE"/>
</payloadData>
</streamDefinition>.
its look like all well while i am sending any message to my jmsProxy queue the message is not reflecting to CEP for event and i am getting this message in CEP
[2014-02-18 11:57:53,159] INFO - {EventBuilderDeployer} Event Builder undeployed successfully : ReadingsDtoBuilder.xml
[2014-02-18 11:57:53,160] INFO - {EventBuilderDeployer} Event builder deployment held back and in inactive state :ReadingsDtoBuilder, Waiting for Input Event Adaptor dependency :jmsProxy
[2014-02-18 12:03:58,006] INFO - {InputEventAdaptorConfigurationFilesystemInvoker} Input Event Adaptor configuration deleted from file system : jmsProxy.xml
[2014-02-18 12:03:58,006] INFO - {InputEventAdaptorDeployer} Input Event Adaptor undeployed successfully : jmsProxy.xml
[2014-02-18 12:03:58,008] INFO - {InputEventAdaptorConfigurationFilesystemInvoker} Input Event Adaptor configuration saved in th filesystem : jmsProxy
[2014-02-18 12:03:58,009] INFO - {InputEventAdaptorDeployer} Input Event Adaptor deployed successfully and in active state : jmsProxy
[2014-02-18 12:03:58,009] INFO - {EventBuilderDeployer} Event Builder undeployed successfully : ReadingsDtoBuilder.xml
[2014-02-18 12:03:58,009] INFO - {EventBuilderDeployer} Event builder deployment held back and in inactive state :ReadingsDtoBuilder, Waiting for Input Event Adaptor dependency :jmsProxy
Looking at your configuration, it seems that the event builder configuration is incorrect. Event adaptor type should be 'jms' in the event builder configuration.
<from eventAdaptorName="jmsProxy" eventAdaptorType="jms">
Please correct this as above to get it working. You can enable tracing [1] to see if messages come to a particular component of CEP.
[1] https://docs.wso2.org/display/CEP300/CEP+Event+Tracer
I am working with wso2cep3.0.0,
My input source and out put source is JMs.I written my Input event adapter and output event adapter like this
Input adapter
is
<?xml version="1.0" encoding="UTF-8"?>
<inputEventAdaptor name="jmsProxy" statistics="disable" trace="enable"
type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
<property name="java.naming.provider.url">tcp://localhost:61616</property>
<property name="transport.jms.SubscriptionDurable">false</property>
<property name="transport.jms.UserName">admin</property>
<property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
<property name="transport.jms.Password">admin</property>
<property name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</property>
<property name="transport.jms.DestinationType">queue</property>
</inputEventAdaptor>
and my
Output event adapter
is
<?xml version="1.0" encoding="UTF-8"?>
<outputEventAdaptor name="OUTJmsProxy" statistics="disable" trace="disable"
type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
<property name="java.naming.security.principal">admin</property>
<property name="java.naming.provider.url">tcp://localhost:61616</property>
<property name="java.naming.security.credentials">admin</property>
<property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
<property name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</property>
<property name="transport.jms.DestinationType">queue</property>
</outputEventAdaptor>
and my input message in jmsproxy jms queue is like this
<soapenv:Body xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<uuid>cc253480-95b3-418e-b282-7e87f885c99e</uuid>
<Remarks>t4</Remarks>
<ReadingsLiteTaildtos>
<ReadingsLiteTaildto>
<FinalValue>70</FinalValue>
<InputText>Chiller Feeder Current R - Ph</InputText>
<InputValue>0.0</InputValue>
<ParameterId>-2499999974</ParameterId>
<SlNo>1</SlNo>
</ReadingsLiteTaildto>
<ReadingsLiteTaildto>
<FinalValue>70</FinalValue>
<InputText>Chiller Feeder Current Y - Ph</InputText>
<InputValue>0.0</InputValue>
<ParameterId>-2499999973</ParameterId>
<SlNo>2</SlNo>
</ReadingsLiteTaildto>
<ReadingsLiteTaildto>
<FinalValue>70</FinalValue>
<InputText>Chiller Feeder Current B - Ph</InputText>
<InputValue>0.0</InputValue>
<ParameterId>-2499999972</ParameterId>
<SlNo>3</SlNo>
</ReadingsLiteTaildto>
<ReadingsLiteTaildto>
<FinalValue>70</FinalValue>
<InputText>Chiller Energy Meter Reading</InputText>
<InputValue>0.0</InputValue>
<ParameterId>-2499999971</ParameterId>
<SlNo>4</SlNo>
</ReadingsLiteTaildto>
</ReadingsLiteTaildtos>
<ReadingDateTime>1381757157596</ReadingDateTime>
<PartyBranchId>-2500000000</PartyBranchId>
<ParametersetId>-2499999974</ParametersetId>
<AssetId>-2499999995</AssetId>
<TaskId>811291126760647</TaskId>
<WorkOUId>-1</WorkOUId>
<activityid>-2500000000</activityid>
<userid>-2499999993</userid>
<entrymode>0</entrymode>
<DeviceId>-1</DeviceId>
</soapenv:Body>
i wish to raise an event when final value cross the max value like more than 100
so how would i write Stream and
ExecutionPlan
In stream-manger-config.xml file consist
3 section
1.metaData 2.Correlation Data 3.Payload Data
so above message how would i define which data is under which section
one more we should define input payload and out payload as well in same stream config file else we need to define separate
Is cep help for this usecase or not
Thanx in Advance.
Yes, this is a typical usecase for CEP.
You can use an 'event builder' similar to following.
<?xml version="1.0" encoding="UTF-8"?>
<eventBuilder name="ReadingsDtoBuilder" statistics="disable"
trace="disable" xmlns="http://wso2.org/carbon/eventbuilder">
<from eventAdaptorName="jmsEventReceiver" eventAdaptorType="jms">
<property name="transport.jms.Destination">ReadingsQueue</property>
</from>
<mapping customMapping="disable"
parentXpath="//ReadingsLiteTaildtos" type="xml">
<property>
<from xpath="//ReadingsLiteTaildto/ParameterId"/>
<to name="meta_parameterId" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/Slno"/>
<to name="meta_slno" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/FinalValue"/>
<to name="finalValue" type="int"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/InputText"/>
<to name="inputText" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/InputValue"/>
<to name="inputValue" type="double"/>
</property>
</mapping>
<to streamName="org.sample.readings.dto.stream" version="1.0.0"/>
</eventBuilder>
The execution plan can be as follows.
<?xml version="1.0" encoding="UTF-8"?>
<executionPlan name="ReadingsAnalyzer" statistics="disable"
trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
<description>This execution plan analyzes readings and triggers notifications based on threshold.</description>
<siddhiConfiguration>
<property name="siddhi.enable.distributed.processing">false</property>
<property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
</siddhiConfiguration>
<importedStreams>
<stream as="readings" name="org.sample.readings.dto.stream" version="1.0.0"/>
</importedStreams>
<queryExpressions><![CDATA[from readings[finalValue > 100]
select *
insert into notificationStream;]]></queryExpressions>
<exportedStreams>
<stream name="notificationStream" valueOf="notificationStream" version="1.0.0"/>
</exportedStreams>
</executionPlan>
You can define streams inside stream-manager-config.xml similar to the following.
<streamDefinition name="org.sample.readings.dto.stream" version="1.0.0">
<metaData>
<property name="parameterId" type="STRING"/>
<property name="slno" type="STRING"/>
</metaData>
<payloadData>
<property name="finalValue" type="INT"/>
<property name="inputText" type="STRING"/>
<property name="inputValue" type="DOUBLE"/>
</payloadData>
</streamDefinition>
<streamDefinition name="notificationStream" version="1.0.0">
<metaData>
<property name="parameterId" type="STRING"/>
<property name="slno" type="STRING"/>
</metaData>
<payloadData>
<property name="finalValue" type="INT"/>
<property name="inputText" type="STRING"/>
<property name="inputValue" type="DOUBLE"/>
</payloadData>
</streamDefinition>
In wso2 esb 4.5.1, i don't have option of direct task scheduling for sequence or proxy service. so, i try to use property name SoapAction and to in task scheduling but iam getting the below error,
ERROR - TaskManagementHelper Invalid XML has been provided for property : message
ERROR - TaskManagementHelper Invalid XML has been provided for property : format
Here is a sample "Scheduled Task" that inject 2 times an XML message
<root>
<node1>value1</node1>
</root>
It works with ESB 4.5.1
<?xml version="1.0" encoding="UTF-8"?>
<task xmlns="http://ws.apache.org/ns/synapse"
name="TestTask"
class="org.apache.synapse.startup.tasks.MessageInjector"
group="synapse.simple.quartz">
<trigger count="2" interval="5"/>
<property xmlns:task="http://www.wso2.org/products/wso2commons/tasks"
name="format"
value="application/xml"/>
<property xmlns:task="http://www.wso2.org/products/wso2commons/tasks"
name="to"
value="TestTaskProxy"/>
<property xmlns:task="http://www.wso2.org/products/wso2commons/tasks" name="message">
<root xmlns="">
<node1>value1</node1>
</root>
</property>
</task>
format and to properties are literal types
message property is an XML type