Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the Expected behaviour of sum function in a timeTumbling window type. #10

Open
bloomfm100 opened this issue Oct 7, 2018 · 2 comments

Comments

@bloomfm100
Copy link

I am running the steams example from > Labs > Streams: Aggregate and I am curious about the expected behaviour when using a SUM style aggregate approach.

When I run the application from the example code it is working all fine and I can see the correct responses that at every 5000 ms it produces the correct response. However if I leave the app running and don't inject any messages I get no message at all. It seems the absence of invoking the http request does not create a result of zero. Can you confirm this is expected?

If it is expected what would be the recommend means for me to send to a downstream system that the result of 0 messages is 0 messages received. I am asking because in my use case I want to create a stream of data that I am using to track items and display the amount of items currently being tracked. However there will be times when there are 0 messages received in the time window. I need a way to notify downstream that I am still tracking but currently there are no items being tracked.

For example:
Time window 1: 1000 messages from 5 unique items = Result 5 Items being tracked
Time window 2: 1500 messages from 5 unique items = Still result 5 Items being tracked
Time window 3: 0 messages received so no unique items --> Currently no message. Therefore am I still tracking 5 or 0 items.

I need a way for a sum result to be available even if I receive no messages.

The version of the demo that I was using that now drives my question is detailed below:

"name": "aggregator",
"type": "flogo:app",
"version": "0.0.1",
"appModel": "1.0.0",

@bloomfm100
Copy link
Author

Is there any updates on this question ? I would be keen to know either way and what is expected.

@mellistibco
Copy link
Member

Hi @bloomfm100 sorry for the delay in responding. You're correct, if there are no events coming into the stream pipeline nothing can be emitted indicating that there were zero events. The pipeline only operates against incoming data, the window will only be set once the first event arrives.

There is no easy way to force the window to always operate if no events are arriving. Perhaps you can consider a timer trigger?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants