Skip to content
Advertisement

How to buffer and group elements in Reactor Flux in Java

Given an infinite flux of objects, where each object has an ID, how can I use flux to create a buffered list of updates grouped by ID property (keeping the last emitted value)? Thanks

Example

JavaScript

Something like the following would be perfect but it seems to wait the end of the flux in my tests instead of buffering.

JavaScript

It works with buffer and custom logic for grouping

JavaScript

Advertisement

Answer

I was able to achieve it with the reactive grouping

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement