Search code examples
java.netapache-kafkamessaging

How does a Kafka consumer choose from which topic to poll next?


Suppose, I have a consumer subscribed to multiple topics. Which topic is chosen, when I do a poll? I'm using RdKafka .Net for the client. Is there a way I can influence, which topic is chosen?


Solution

  • The consumer does poll for all topic partitions (that are not paused). The broker decides what data to return. You cannot influence the broker's behavior directly.

    Not sure if RdKafka has an API to pause and resume partitions. I only now Java KafkaConsumer, that offers methods #pause() and #resume().