we didn’t port this exact same functionality to Axon 4. Axon 4 doesn’t have the same notion of replays as Axon 2 did. That is because it will simply “reset” the tracking position to the beginning of a Stream. It will then just process events from that point forward.
Also, Axon 4 will automatically skip events it doesn’t need to process. If you use AxonServer (>= 4.2), it will automatically blacklist these events as well, so that AxonServer stops sending them to the client.
If you want to explicitly open a stream with only certain events, there is no way currently other than reading the stream (and optionally blacklisting them). We have been discussing re-introducing this feature in some form, but haven’t gotten to it yet.
Note that retrieving events for an aggregate can be done using EventStore.readEvents(aggregateIdentifier, 0). The 0 parameter forces Axon to start with the first event, rather than attempting to load a snapshot. You can then pass these events to you handler if you wish to replay.
Out of curiosity, what is the reason you want to ad-hoc replay events for a specific aggregate?