Reputation: 2315
Given an implementation of the EventHostProcessor, how can I force replay of events from the last checkpoint within the same processor?
To be clear, assume my partition is 100 deep and I have consumed 10 messages. When I invoke this replay method, I would then want onEvent
to return the first message from my previously consumed 10.
In C# this seems possible through the use of the Stopwatch
but I do not see the Java equivalent.
Upvotes: 0
Views: 498
Reputation: 2315
The solution seems to be that you can either checkpoint to the high-water mark of the last consumed EventData or you can checkpoint to another EventData instance.
Such as context.checkpoint(data);
There does not seem to be a way to arbitrarily rewind to an earlier event within an EventProcessorHost.
Upvotes: 1
Reputation: 24148
The simple way is that using Java StopWatch
class of Apache Commons Lang library and following the C# code in the tutorial Receive events from Azure Event Hubs using the .NET Framework
to write the same feature code in Java with azure-event-hubs-java
library (on GitHub here, maven dependency for EventProcessorHost
here).
Hope it helps.
Upvotes: 0