The documentation is correct in that a reader can only "read" a non-partitioned topic or one specific partition of a topic.
To get a list of the partitions, you can use `PulsarClient.getPartitionsForTopic()` and then create a reader for each partitions. -- Matteo Merli <matteo.me...@gmail.com> On Mon, Nov 4, 2019 at 3:30 AM Jinfeng Huang <h...@streamnative.io> wrote: > > From the code snippet, it seems that the description in the document is > obsolete. If so, we can update the doc accordingly. > Could any eng confirm the issue? > > Best Regards, > Jennifer > > > On Sun, Nov 3, 2019 at 4:51 PM Brian Candler <b.cand...@pobox.com> wrote: >> >> In the documentation there is an admonition: >> >> Non-partitioned topics only >> >> The reader interface for Pulsar cannot currently be used with partitioned >> topics. >> >> Is this still true? I notice in ReaderImpl.Java >> >> final int partitionIdx = >> TopicName.getPartitionIndex(readerConfiguration.getTopicName()); >> consumer = new ConsumerImpl<>(client, >> readerConfiguration.getTopicName(), consumerConfiguration, >> listenerExecutor, partitionIdx, false, consumerFuture, >> SubscriptionMode.NonDurable, >> readerConfiguration.getStartMessageId(), >> readerConfiguration.getStartMessageFromRollbackDurationInSec(), >> schema, null, true /* createTopicIfDoesNotExist */); >> >> Thanks, >> >> Brian.