You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my code i have to use Offset specification instead of LastConsumed, and inside the callback check if consumer context offset equals QueryOffset at the start of consumer, than this message was processed and it should be skipped
But is it correct to make someting like this: query offset before starting of consumer, and if offset exists increment it:
offset, err:=env.QueryOffset(consName, streamName)
//handle errorifoffsetExists {
offset++// is this increment correct
}
consCopy, err:=env.NewConsumer(streamName, handleMessages, stream.
NewConsumerOptions().
SetManualCommit().
SetOffset(stream.OffsetSpecification{}.Offset(offset)).SetConsumerName(consName),
)
If this solution is correct, may be it's worth to setup lastOffset + 1 here
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Hi @HustonMmmavr, LastConsumed API was meant to help the user to restart from the last stored message.
Over the years, I have seen that it created more confusion than helping.
Also the name is misleading.
This is why I decided to deprecate the API, The correct way is what you have done:
offset, err:=env.QueryOffset(consName, streamName)
//handle errorifoffsetExists {
offset++// is this increment correct
}
Is your feature request related to a problem? Please describe.
Hello!
I've found that LastConsumed offset would replay the last message at the stream.
Here is a repro:
The output is next:
Is it an expected behaviour?
Describe the solution you'd like
In my code i have to use Offset specification instead of LastConsumed, and inside the callback check if consumer context offset equals QueryOffset at the start of consumer, than this message was processed and it should be skipped
But is it correct to make someting like this: query offset before starting of consumer, and if offset exists increment it:
If this solution is correct, may be it's worth to setup lastOffset + 1 here
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: