Hi Alain,

Using EventAdmin disconnects the consumers from the producer in a way which 
prevents any back-pressure from being applied, although in this case it seems 
as though absolute back pressure may not be very helpful, as you can’t make the 
commits come in more slowly.

One thing that you could do is to use PushStreams inside your event handlers to 
do some buffering and parallel processing. For example, when an Event comes in 
you could push it into a SimplePushEventSource with a buffer. Your push stream 
pipeline can then process up to N requests in parallel, using the buffer to 
“hold” events if too many come in in one go.

Did you have any thoughts about anything else that you might want to do?


> On 1 Oct 2018, at 11:30, Alain Picard via osgi-dev <[email protected]> 
> wrote:
> 
> We are using a number of Event Handlers to handle post-commit updates to 
> notifications, metrics, search, etc.
> 
> A number of those process can be somewhat lengthy, such as email or SMS 
> notifications. For search, we have build our ElasticSearch to use the async 
> mode with Promises. 
> 
> As is documented in 113.8.2, we should not stall our handlers, so I am 
> looking for guidance on how best to integrate push streams with Event 
> Handlers (if that is the right approach) and how can any type of back 
> pressure can be applied given the disconnected nature of Events.
> 
> Thanks
> Alain
> 
> _______________________________________________
> OSGi Developer Mail List
> [email protected]
> https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to