As a user of Project Reactor that also wants to use Spring Integration, I'd like to perform the following operation, that will work in such way that:
flux.buffer(duration)
.doOnNext(bulkWriteToCockroach())
.doOnNext(bulkWriteToPulsar());
In the beginning, I thought the solution is to do stuff like the following wrong code:
IntegrationFlow.from(myflow)
.aggregate(myTimeBasedAggregation())
.handle(bulkWriteToCockroach())
.handle(bulkWriteToPulsar());
Of course, it wouldn't work due to outputChannel issues. I would like to know how can I perform operations one after another (e.g. don't continue to the Pulsar writes until the CockroachDB writes are completed, and stop the flow for these messages if the first operation fails).
I'm thinking of using the Spring Integration transactions support but I'm afraid of its usage with Reactor.
I've also seen that there is something called gateway(), but I've couldn't manage to find a usable example of a JavaDSL based usage of it.