Skip to content

Is there a way to replay messages from the JetStream staring from some sequence number? #827

Answered by scottf
vol-ale asked this question in Q&A
Discussion options

You must be logged in to vote

When you create your consumer you can use

ConsumerConfiguration.Builder()
    .WithDeliverPolicy(DeliverPolicy.ByStartSequence)
    .WithStartSequence(42)
    .WithAckPolicy(AckPolicy.None)
    ...
    .Build();

The start sequence value would be the stream sequence + 1 of the last message you read. You can find the stream sequence in the Msg.MetaData.StreamSequence.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vol-ale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants