AxonFramework icon indicating copy to clipboard operation
AxonFramework copied to clipboard

Disable batch optimization for token-based event reading

Open smcvb opened this issue 3 years ago • 1 comments

This pull request disables batch optimization for token-based event reading in the BatchingEventStorageEngine. The batch optimization is intended to not retrieve a second batch of events to cover for potential gaps the first batch. This optimization is desirable for aggregate event streams, as these close once the end is reached. For token-based event reading the stream does not necessarily close once reaching the end, thus the optimization will block further event retrieval.

To test the fix, I've adjusted the EmbeddedEventStoreTest to require concrete implementations for InMemory, JPA, and JDBC. The original EmbeddedEventStoreTest was based on the InMemoryEventStorageEngine, which does not implement the BatchingEventStorageEngine. Hence, we did not spot the issue sooner.

This pull request resolves #2382.

smcvb avatar Sep 21 '22 09:09 smcvb