Changing EventBus type without replaying events

At the moment we are rebuilding a backend application with Axon, at a later moment we will also rebuild the frontend to implement good eventsourcing as well.
For now the frontend is very synchronous so we want to implement the backend synchronously using a SubscribeEventBus and SendAndWait to wait for all events to be processed.
At a later stage we want to switch this to a TrackingEventBus fully asynchronous.
I have noticed that when you switch busses that a tracking token is added to the TokenStore and all events are replayed and placed in the readmodel, however we would like to switch busses without having to replay all the events, is this possible?

Hi Thijmen,

by default, when a processor starts for the first time, it creates a Token that points at the beginning of the stream (where the oldest events are). You can change this in the EventProcessingConfigurer using the registerTrackingEventProcessor method. There is one method that allows you to provide a TrackingEventProcessorConfiguration. This class contains the configuration properties for a Tracking Processor. The relevant configuration for this case is the “initial token”, which you can define in the “andInitialTrackingToken” method. You’ll want to use the HEAD token as the initial tracking token in this case.

Basically, it would like as follows:

TrackingEventProcessorConfiguration.forSingleThreadedProcessing() // or multi-threaded, if you want
.andInitialTrackingToken(StreamableMessageSource::createHeadToken);

Hope this helps.