Coder Social home page Coder Social logo

Comments (3)

BuddhiWathsala avatar BuddhiWathsala commented on July 27, 2024

Here in the next release of the siddhi operator, we are planning to change the siddhi parser REST endpoint to create failover siddhi apps.

The request of the endpoint will contain a siddhi app like below.

@App:name("MonitorApp")
@App:description("Description of the plan") 

@sink(type='log', prefix='LOGGER')
@source(
    type='http',
    receiver.url='http://0.0.0.0:8080/example',
    basic.auth.enabled='false',
    @map(type='json')
)
define stream DevicePowerStream (type string, deviceID string, power int);

@sink(type='log', prefix='LOGGER')
define stream MonitorDevicesPowerStream(sumPower long);
@info(name='monitored-filter')
from DevicePowerStream#window.time(100 min)
select sum(power) as sumPower
insert all events into MonitorDevicesPowerStream;

And the parser will divide this siddhi app to partial siddhi app (passthrough and process apps).

Passthrough App

@App:name("MonitorApp-0") 
@source(type='http', receiver.url='', basic.auth.enabled='', @map(type='json'))

define stream passthroughDevicePowerStream (type string, deviceID string, power int);
@sink(type='nats',cluster.id='example-stan',destination = 'FailoverMonitorApp_DevicePowerStream', bootstrap.servers='nats://example-nats:4222',@map(type='text')) 

define stream DevicePowerStream (type string, deviceID string, power int);
from passthroughDevicePowerStream select * insert into DevicePowerStream;

Process App

@App:name("MonitorApp-1") 
@source(type='nats',cluster.id='example-stan',destination = 'FailoverMonitorApp_DevicePowerStream', bootstrap.servers='nats://example-nats:4222',@map(type='text')) 

define stream DevicePowerStream (type string, deviceID string, power int);
@info(name='monitored-filter')

from DevicePowerStream#window.lengthBatch(3)
select sum(power) as sumPower
insert all events into MonitorDevicesPowerStream;

Note that here by default siddhi operator uses NATS streaming as the messaging layer.

from siddhi-operator.

mohanvive avatar mohanvive commented on July 27, 2024

Fixed in #34 by Buddhi..

from siddhi-operator.

pcnfernando avatar pcnfernando commented on July 27, 2024

Added support with #35

from siddhi-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.