Hi chamila,
On Thu, Feb 6, 2014 at 10:57 AM, Chamila Wijayarathna <cham...@wso2.com>wrote: > Hi all, > I have following stream definition in my publisher. > > String HTTPD_LOG_STREAM = "log_analyzer.call_records_test"; > > *streamId = dataPublisher.defineStream("{" +* > * " 'name':'" + HTTPD_LOG_STREAM + "'," +* > * " 'version':'" + VERSION + "'," +* > * " 'nickName': 'Call record'," +* > * " 'description': 'Sample '," +* > * " 'metaData':[" +* > * " {'name':'clientType','type':'STRING'}" +* > * " ]," +* > * " 'payloadData':[" +* > * " > {'name':'callingPartyNumber','type':'STRING'}," +* > * " > {'name':'CalledPartyNumber','type':'STRING'}," +* > * " {'name':'duration','type':'LONG'}," +* > * " {'name':'timestamp','type':'STRING'}" +* > * " ]" +* > * "}");* > > I'm trying to send following data to BAM using above mentioned stream in > followng manner. > > *Object[] meta = new Object[]{* > * "external"* > * };* > > * Object[] payload = new Object[]{* > * "0777777777 <0777777777>",* > * "071717171",* > * "500",* > According to the stream definition, this value should be a LONG value, but you are passing as string. Try to change it as 500, without double quotation. Thanks, Sinthuja. > * "2014"* > > * };* > * Event event = new Event(streamId, System.currentTimeMillis(), > meta, null,* > * payload);* > * System.out.println(event);* > * dataPublisher.publish(event);* > > When I run my publisher matching stream definition is created in > META_KS.STREAM_DEFINITION and column family with stream name is created in > EVENT_KS. > > *KEY: STREAM_DEFINITION > VALUE: > {"streamId":"log_analyzer.call_records_test:1.0.0","name":"log_analyzer.call_records_test","version":"1.0.0","nickName":"Httpd_Log_Stream","description":"Sample > of Httpd > logs","metaData":[{"name":"clientType","type":"STRING"}],"payloadData":[{"name":"callingPartyNumber","type":"STRING"},{"name":"CalledPartyNumber","type":"STRING"},{"name":"duration","type":"LONG"},{"name":"timestamp","type":"STRING"}]}* > > > When I send events to BAM using above code, I'm getting following exeption in > BAM Console. > > > *ERROR {org.wso2.carbon.databridge.core.internal.queue.QueueWorker} - > Wrongly formatted event sent for carbon.super > org.wso2.carbon.databridge.core.exception.EventConversionException: Error > when converting log_analyzer.call_records_test:1.0.0 of event bundle with > events 1 > 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: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 > at java.util.ArrayList.rangeCheck(ArrayList.java:604) > at java.util.ArrayList.get(ArrayList.java:382) > at > org.wso2.carbon.databridge.receiver.thrift.converter.ThriftEventConverter.toObjectArray(ThriftEventConverter.java:53) > at > org.wso2.carbon.databridge.receiver.thrift.converter.ThriftEventConverter.createEventList(ThriftEventConverter.java:116) > ... 8 more > * > > > But I don't see any mismatch between receiving stream and events I'm > sending. How can I solve this problem? > > Thank You. > -- > *Chamila Wijayarathna* > Engineering Intern, > WSO2 Inc. > > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- *Sinthuja Rajendran* Software Engineer <http://wso2.com/> WSO2, Inc.:http://wso2.com Blog: http://sinthu-rajan.blogspot.com/ Mobile: +94774273955
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev