question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Output when SessionTimeoutWindow() ends

See original GitHub issue

Hello,

I have been working with Trill for an Real-time application where we need to aggregate live streaming data and output when a SessionTimeoutWindow closes. Using the syntax:

var query = inputStream
            .SessionTimeoutWindow(TimeSpan.FromSeconds(30).Ticks)
            .GroupAggregate(
            x => x.DeviceGuid,
            x => x.Min(v => DateTime.Parse(v.ReceivedTime)),
            x => x.Max(v => DateTime.Parse(v.ReceivedTime)),
            (key, startTime, endTime) => new { key.Key, startTime, endTime }) 

and registering the input as:

var inputStream = this.queryContainer.RegisterInput(
                this.input,
                DisorderPolicy.Adjust(),
                FlushPolicy.FlushOnPunctuation,
                PeriodicPunctuationPolicy.Time((ulong)TimeSpan.FromSeconds(1).Ticks),
                OnCompletedPolicy.EndOfStream);

Trill is able to output whenever it receives a Punctuation and returns intermediary results whenever it receives a Punctuation. What we need instead is Trill to only return when the Session closes. I have tried various combinations to remove the dependency on Punctuations and instead register the input with other settings, but Trill doesn’t output anything in that case. Is there a way I can force Trill to output the result of the query only when the SessionTimeoutWindow closes and not the intermediate states when it receives the Punctuation? Thanks for the help.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
shreyasraghunathcommented, Dec 1, 2020

Hi @wassim-k , We couldn’t get any answer to this question. Trill is a very good product but unfortunately lacks community support. Hence, we decided to go with Kafka Streams itself.

0reactions
wassim-kcommented, Dec 1, 2020

That worked perfectly. Thank you @peterfreiling your help so far has been invaluable for our project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

All window need to close while user session expire How?
I am trying to close window with session storage, its not working y ?? For me I open new window in different &&...
Read more >
Session Timeout
Session timeout represents the event occuring when a user does not perform any action on a web site during an interval (defined by...
Read more >
Session Window (Azure Stream Analytics)
Session windows group events that arrive at similar times, filtering out periods of time where there is no data. Session window function has ......
Read more >
Your Session Has Timed Out
Every web request to that server will include its own cookie and associated session id until it expires, usually many months or even...
Read more >
How to Set Up Automatic Session Timeout with Ajax
When the user logs in, create a JavaScript timer with the window.setTimeout() method. The timer will call a function that ends the session...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found