This message was deleted.
# general
s
This message was deleted.
πŸ‘€ 1
d
Hi Jeff, I am not sure what the
watermarkEmitIntervalMs
actually does, and I will need to look into the code a bit. However, if your goal is to have an upper bound on the time it takes for a β€œwindow” of events to be sent to your function, i.e., not waiting hours for the next 50k messages, you should use the
windowLengthDurationMs
property to control this. When used in conjunction with the
windowLengthCount
property, a window of events will be processed when either condition is met.
πŸ‘ 1
So if you have
windowLengthCount:50000
and
windowLengthDurationMs:30000
then your function will be triggered when you receive 50k messages or 30 seconds have elapsed, whichever occurs first.
πŸ‘ 1
j
oh, thank you, that is exactly what I want.
d
Please let me know if this works. Looking at the code, it appears that you are not allowed to set both of these values.
j
Indeed, you are correct:
Copy code
java.lang.IllegalArgumentException: Window length for time and count are set! Please set one or the other.
what are the other options for ensuring my batches are flushed on a timer?
πŸ€” 1
d
Speaking with our engineering team, they feel that it will be some time before they can work on improving the windowing capabilities of Pulsar functions. Depending on your exact requirements, there are a few options available. 1) Write an application that does the batching for you rather than relying on the function framework. 2) Use an external stream processing engine such as Apache Flink or Spark that provides native support for time/size-based triggers.
j
hmm. It looks like I need a combination of the CountTriggerPolicy and the TimeTriggerPolicy, with the CountEvictionPolicy
I can work on a PR for this.
πŸ‘ 1
d
That was my option #3. πŸ˜ƒ Please tag me on the PR when you submit it.
j
Will do.