how can subcribe multi topic using only one kafka::clients::KafkaConsumer and thread
RyuShai opened this issue · 1 comments
RyuShai commented
Can i subcribe multi topic using one kafka::clients::KafkaConsumer in single thread ?
kenneth-jia commented
You could subscribe multiple topics with a single KafkaConsumer
, while underlying, each KafkaConsumer
(or KafkaProducer
) would have several internal threads (depending the number of brokers) ...
The subscribe
interface: https://github.com/morganstanley/modern-cpp-kafka/blob/main/include/kafka/KafkaConsumer.h#L70
There're also some testcases about the multiple-topics subscription, e.g. https://github.com/morganstanley/modern-cpp-kafka/blob/main/tests/integration/TestKafkaConsumer.cc#L1706