AxonFramework / AxonFramework

Framework for Evolutionary Message-Driven Microservices on the JVM
https://axoniq.io/
Apache License 2.0
3.32k stars 790 forks source link

Ensure existence of token position on query handling #3088

Open smcvb opened 2 months ago

smcvb commented 2 months ago

Description

Handling eventual consistency can be quite hard. Sometimes you want data to be up-to-date, or fail the query.

Once #3087 is implemented, it will become easier to know to "how far" an action generated events, as the position would be returned. If we could combine that information with an API change on the QueryBus/QueryGateway/QueryMessage to carry the position, there would be a window of opportunity to provide "at least up-to-date" semantics out of the box.

Implementation suggestion

Based on a property in the GenericQueryMessage, (e.g. of type Instant) we can check whether the EventProcessor is up-to-date or at least at the provided date.

Challenges