Skip to content

Instantly share code, notes, and snippets.

@chanakaudaya
Created June 1, 2018 09:23
Show Gist options
  • Save chanakaudaya/7c784034b02c030fd689509ccf2e89ef to your computer and use it in GitHub Desktop.
Save chanakaudaya/7c784034b02c030fd689509ccf2e89ef to your computer and use it in GitHub Desktop.
@App:name("ReceiveAndCount")
@App:description('Receive events via HTTP transport and view the output on the console')
@Source(type = 'http',
receiver.url='http://localhost:8006/productionStream',
basic.auth.enabled='false',
@map(type='json'))
define stream SweetProductionStream (name string, amount double);
@sink(type='log')
define stream TotalCountStream (totalCount long);
-- Count the incoming events
@info(name='query1')
from SweetProductionStream
select count() as totalCount
insert into TotalCountStream;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment