Skip to main content

Posts

Showing posts from May, 2017

WSO2 Siddhi Advance Example

I would like to present you today how to write an advance siddhi query for wso2 das. I would skip basic steps hoping you are already familiar with siddhi event processing language and DAS server. Siddhi - Is an event processing language created by WSO2. this language has a very similar behavior to SQL query language, except siddhi query triggered by a receiving event. siddhi syntaxes bit upside down when compared to traditional SQL. DAS - DAS is the data analytic server introduced by WSO2. Introduction What my example doing is when DAS server is receiving an event it flows through my siddhi example. DAS is connected to an external system and DAS receives events. this event has json body where event-type is hidden. based on the event type we will be pricing the event and pushing updated stream data to a new stream. so to make a result we will have to process the event using siddhi java extension. Before explaining the siddhi query, let me explain you various functions

Printing your json on a web page

printing a json on wasnt easy. it looked messy and made your web page very bad looking. theres a simple solution to overcome this. stringify your json and then put inside a html <pre> tag. you will be amazed of the outcome. jsonBody    in the below example is the json object you wanna print.   <pre> ' + JSON . stringify ( JSON . parse ( jsonBody ) , null , '\t' ) + ' </pre>