Tracking event processor batch optimization

Hi,

I’m trying to optimize the performance of our event handlers when dealing to index documents in elasticsearch through tracking event processors.

For that I’m trying to use batch capabilities offered by axon by building my objects in memory in the context of one batch and calling the bulk index operation in elasticsearch before the commit of the unit of work.

However I have a small issue, sometimes I get conflicts when calling the bulk index because other threads have modified part of the data I’m trying to index.
Then I can throw the exception to the event handler to retry the batch. However I would like to retry only failed documents, not documents that have been properly indexed.
I currently cannot find a way to do that, could someone offer advice ? :slight_smile:

Thanks!

Thomas