pulsar-client-go icon indicating copy to clipboard operation
pulsar-client-go copied to clipboard

Enable seeking individual topic partitions

Open severinson opened this issue 2 years ago • 3 comments

Currently, seeking on a consumer with a KeyShared subscription fails. This PR removes an unnecessary check to seek the underlying partitionConsumer.

severinson avatar Aug 16 '22 15:08 severinson

@codelipenghui I've added tests.

severinson avatar Aug 17 '22 08:08 severinson

If you want to directly perform the seek operation on a partitioned topic, you can refer to the behavior here. https://github.com/apache/pulsar-client-go/pull/782

wolfstudy avatar Aug 22 '22 08:08 wolfstudy

@severinson After checking more details about this part. Before 2.8.0, the Java client only supported seek with the earliest/latest position. https://github.com/apache/pulsar/pull/10033 has introduced a new API https://github.com/apache/pulsar/pull/10033/files#diff-6010f94fead60a5a3ed8aa58a37fe96fdf2cd9c5c1573989cdf89abcb9f9c256R613 which able to provide seek message ID for each partition or topic(For multi-topic/regex consumer)

I think the go client should also follow the same way.

codelipenghui avatar Aug 22 '22 09:08 codelipenghui