hello all,
I am trying to send some events to CEP in WSO2Event Format.
In my publisher I create a stream as follows.

*streamId1 = dataPublisher.defineStream("{" +*
*                    "  'name':'" + STREAM_NAME1 + "'," +*
*                    "  'version':'" + VERSION1 + "'," +*
*                    "  'nickName': 'Statistics'," +*
*                    "  'description': 'Service statistics'," +*
*                    "  'metaData':[" +*

*                    "          {'name':'referer','type':'STRING'}" +*
*                    "  ]," +*
*                    "  'payloadData':[" +*
*                    "          {'name':'SrcIp','type':'STRING'}," +*
*                    "          {'name':'DestIp','type':'STRING'}," +*
*                    "          {'name':'size','type':'STRING'}," +*
*                    "          {'name':'timestamp','type':'STRING'}" +*
*                    "  ]" +*
*                    "}");*

Then I published some events using above stream as follows.

Ob*ject[] meta = new Object[]{*
*                        "MetaData"*
*                };*
*Object[] payload = new Object[]{*
*                        SrcIp,*
*                        DestIp,*
*                        size, // Unix timeStamp*
*                        "600"                        *
*                };*
*Event statisticsEvent = new Event(streamId1, System.currentTimeMillis(),*
*                                                  meta, correlation,
payload);*
*                dataPublisher.publish(statisticsEvent);*

I also created an event builder at CEP for above stream. It has the
following source view.

*<?xml version="1.0" encoding="UTF-8"?>*
*<eventBuilder name="logg" statistics="disable" trace="disable"
xmlns="http://wso2.org/carbon/eventbuilder
<http://wso2.org/carbon/eventbuilder>">*
*    <from eventAdaptorName="WSO2EventAdaptor"
eventAdaptorType="wso2event">*
*        <property
name="stream">org.wso2.log_analyzer.netflow.info1</property>*
*        <property name="version">1.0.0</property>*
*    </from>*
*    <mapping customMapping="enable" type="wso2event">*
*        <property>*
*            <from dataType="meta" name="referer"/>*
*            <to name="ref" type="string"/>*
*        </property>*
*        <property>*
*            <from dataType="payload" name="SrcIp"/>*
*            <to name="src" type="string"/>*
*        </property>*
*        <property>*
*            <from dataType="payload" name="DestIp"/>*
*            <to name="dest" type="string"/>*
*        </property>*
*        <property>*
*            <from dataType="payload" name="size"/>*
*            <to name="size" type="string"/>*
*        </property>*
*        <property>*
*            <from dataType="payload" name="timestamp"/>*
*            <to name="timestamp" type="string"/>*
*        </property>*
*    </mapping>*
*    <to streamName="org.wso2.log_analyzer.out" version="1.0.0"/>*
*</eventBuilder>*

When I run the publisher and send the events to CEP I'm getting following
exeption for each event.

* ERROR - {QueueWorker}  Wrongly formatted event sent for carbon.super*
*org.wso2.carbon.databridge.core.exception.EventConversionException: Error
when converting MetaData of event bundle with events 36*
* at
org.wso2.carbon.databridge.receiver.thrift.converter.ThriftEventConverter.createEventList(ThriftEventConverter.java:126)*
* at
org.wso2.carbon.databridge.receiver.thrift.converter.ThriftEventConverter.toEventList(ThriftEventConverter.java:88)*
* at
org.wso2.carbon.databridge.core.internal.queue.QueueWorker.run(QueueWorker.java:72)*
* at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)*
* at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)*
* at java.util.concurrent.FutureTask.run(FutureTask.java:166)*
* 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:724)*
*Caused by:
org.wso2.carbon.databridge.core.exception.EventConversionException: No
StreamDefinition for streamId MetaData present in cache *
* at
org.wso2.carbon.databridge.receiver.thrift.converter.ThriftEventConverter.createEventList(ThriftEventConverter.java:112)*
* ... 8 more*

What is the problem here? How can I solve this?


-- 
*Chamila Wijayarathna*
Engineering Intern,
WSO2 Inc.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to