Closed HustonMmmavr closed 5 months ago
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 error
if offsetExists {
offset++ // is this increment correct
}
Got it! Thank you)
The method is deprecated now https://github.com/rabbitmq/rabbitmq-stream-go-client/pull/324.
Thank you @HustonMmmavr
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