Hi, On 13 May 2013 20:54, Pradeep Fernando <[email protected]> wrote:
> > > > On Mon, May 13, 2013 at 8:38 PM, Lasantha Fernando <[email protected]>wrote: > >> Hi Pradeep, >> >> Regarding the configuration for transport adaptors ( >> <builder:from></builder:from>), the properties and the number of >> properties will change depending on the transport adaptor type. >> eg: For FIX, there might be additional parameters depending on the >> message structure, or for JMS, there will be topics etc. >> > yes you are right. But, still you can get rid of property elements. The > trick is to inject any element field in to actual implementation class. The > concrete implementation knows how to interpret them, right.? The config > builder should act as a framework, where it reads the elements and inject > them in to the underlying concrete impl. > > for an example you can refer this [1]. > > Yes, that approach seems more preferable and makes sense. This configuration sample came from a basic first-cut implementation of the event-builder component. Will incorporate your suggestions when developing further. > and how do you allow users to configure their own builder. ? (not sure > whether this question is relevant at all, but felt like it as an extension > point) > > Actually, what I meant by extensions was like whether this configuration syntax would be generic enough if we need to develop other mapping types in the future. I don't think currently there is a usecase for users configuring their own builder. > > [1] > https://svn.wso2.org/repos/wso2/carbon/kernel/trunk/distribution/kernel/carbon-home/repository/conf/tomcat/catalina-server.xml > > please use default XML namespace in your elements as well. > Will do. Any other comments, feedback is greatly appreciated... Thanks, Lasantha > > >> >> So we thought having a generic approach of having a property name and >> value would be cleaner. >> >> On 13 May 2013 18:46, Pradeep Fernando <[email protected]> wrote: >> >>> >>> >>> >>> On Mon, May 13, 2013 at 6:40 PM, Pradeep Fernando <[email protected]>wrote: >>> >>>> Hi, >>>> >>>> Is it possible to get rid of property elements, >>>> >>>> eg: <streamName>analytics_statistics</streamName> >>>> >>>> This way, the one who process the xml should have the knowledge of how >>>> to process the stuff. >>>> >>>> >>>> thanks, >>>> --pradeep >>>> >>>> >>>> On Mon, May 13, 2013 at 6:20 PM, Lasantha Fernando >>>> <[email protected]>wrote: >>>> >>>>> Hi all, >>>>> >>>>> For CEP 3.0.0 we are keeping separate configuration files for the >>>>> event builder component which will be saved as an XML file. The event >>>>> builder component will basically subscribe to a Transport Adaptor and map >>>>> from a supported format like XML, Event, JSON or Text to an event >>>>> stream/Siddhi stream. We came up with a sample configuration syntax below >>>>> [1]. >>>>> >>>>> Please give your comments, suggestions on the syntax ( readability, >>>>> easy to understand, generic enough to support future extensions etc.) >>>>> >>>> >>> what are the supported extension points of this configuration/use-case. >>> Can't figure out just by looking at the config. >>> >> >> The usecases for this configuration will include, >> >> - supporting different mappings >> >> e.g. for XML it might be something like >> >> <builder:mapping type="xml" prefix="quotedata" namespace=" >> http://ws.cdyne.com/"/> >> <builder:property name="price" >> xpath="//quotedata:StockQuoteEvent/quotedata:LastTradeAmount" >> type="java.lang.Double"/> >> <builder:property name="symbol" >> xpath="//quotedata:StockQuoteEvent/quotedata:StockSymbol" >> type="java.lang.String"/> >> </builder:mapping> >> >> we need to support XML,JSON,Tuple(Event/WSO2Event),Text,Map at the least. >> >> - supporting different configurations for different transport adaptor >> types >> - Currently, the information in <builder:to></builder:to> will be used >> by Siddhi engine to receive events as object arrays and other components >> will be receiving wso2 events. So catering for those two types by this >> configuration is needed at the least. >> >> Thanks for your suggestions.. :-) >> >> Thanks, >> Lasantha >> >> >>> >>> >>>> >>>>> [1] >>>>> >>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>> <builder:eventBuilder xmlns:builder=" >>>>> http://wso2.org/carbon/eventbuilder"> >>>>> <builder:from transportAdaptortype="wso2event" >>>>> transportAdaptorName="wso2eventadaptor"> >>>>> <builder:property >>>>> name="streamName">analytics_Statistics</builder:property> >>>>> <builder:property name="version">1.3.0</builder:property> >>>>> </builder:from> >>>>> <builder:mapping type="wso2event"> >>>>> <builder:property> >>>>> <builder:from name="price" type="payload"/> >>>>> <builder:to name="stockPrice" type="double"/> >>>>> </builder:property> >>>>> <builder:property> >>>>> <builder:from name="symbol" type="metadata"/> >>>>> <builder:to name="symbol" type="string"/> >>>>> </builder:property> >>>>> </builder:mapping> >>>>> <builder:to streamName="stockStream" version="1.0.0"/> >>>>> </builder:eventBuilder> >>>>> >>>>> Thanks, >>>>> Lasantha >>>>> >>>>> -- >>>>> *Lasantha Fernando* >>>>> Software Engineer - Data Technologies Team >>>>> WSO2 Inc. http://wso2.com >>>>> >>>>> email: [email protected] >>>>> mobile: (+94) 71 5247551 >>>>> >>>>> _______________________________________________ >>>>> Dev mailing list >>>>> [email protected] >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>>> >>>> -- >>>> *Pradeep Fernando* >>>> Member, Management Committee - Platform & Cloud Technologies >>>> Senior Software Engineer;WSO2 Inc.; http://wso2.com >>>> >>>> blog: http://pradeepfernando.blogspot.com >>>> m: +94776603662 >>>> >>> >>> >>> >>> -- >>> *Pradeep Fernando* >>> Member, Management Committee - Platform & Cloud Technologies >>> Senior Software Engineer;WSO2 Inc.; http://wso2.com >>> >>> blog: http://pradeepfernando.blogspot.com >>> m: +94776603662 >>> >> >> >> >> -- >> *Lasantha Fernando* >> Software Engineer - Data Technologies Team >> WSO2 Inc. http://wso2.com >> >> email: [email protected] >> mobile: (+94) 71 5247551 >> > > > > -- > *Pradeep Fernando* > Member, Management Committee - Platform & Cloud Technologies > Senior Software Engineer;WSO2 Inc.; http://wso2.com > > blog: http://pradeepfernando.blogspot.com > m: +94776603662 > -- *Lasantha Fernando* Software Engineer - Data Technologies Team WSO2 Inc. http://wso2.com email: [email protected] mobile: (+94) 71 5247551
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
