rabbitmq-stream-rust-client icon indicating copy to clipboard operation
rabbitmq-stream-rust-client copied to clipboard

Change consumer offset after creation

Open Eyald6 opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

We sometime encounter a situation where a fresh consumer is created, without prior knowledge of the stream. The consumer wants to search the stream to find a specific offset in which it should begin reading - for example find the exact offset which contains a message with a specific timestamp, given that the messages in stream are ordered.

To do this, we can simply perform a binary search across the stream to find our offset (again, given that the messages in the stream are ordered, which is the case). Unfortunately, we currently have to create a new consumer for each search probe.

I am mostly worried about performance hits due to this logic, but I am not aware of a way to go around it currently.

Describe the solution you'd like

I wonder, if it will be possible to simply send a new subscribe command or even better - simply change the offset of the current subscriber if it is even possible.

Describe alternatives you've considered

I didn't find any way to do so in other libraries (even amqp), and didn't find any documentation about a way to do it, so I'm not even sure if the server support such a feature.

Additional context

No response

Eyald6 avatar May 18 '23 08:05 Eyald6