admin管理员组

文章数量:1333404

TLDR; How is

void seek(Function<String,Object> function)
   throws PulsarClientException

in the pulsar reader API expected to be used?

-- More info

I'd like to read messages from a pulsar topic that is partitioned.

Previously I have used seek(Long timestamp) of PulsarReader but there is a note there, "Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the seek() on the individual partitions."

Then I read the seek(Function<String,Object> function) API, which says "The Function input is topic+partition. It returns only timestamp or MessageId."

How does one create a Function that refers to, say, a partition called, say, persistent://my-path/.../my-topic-v1-partition-0, persistent://my-path/.../my-topic-v1-partition-1, persistent://my-path/.../my-topic-v1-partition-2

Or perhaps this API was not meant to be exposed?

I see the open source implementation here and it looks like the passed in Function is supposed to return an Object seekPosition but to construct the Function to begin with is not clear.

本文标签: javaPulsar Reader seek for topics with partitionsStack Overflow