Hello,

Does the KafkaConsumer subscribe methods allow for incremental topic
subscriptions?

By incremental I mean that only the added and removed topics and
subscribed/unsubscribes respectively and the other topics are not
unsubscribed and subscribed back.

>From the javadoc API on the subscribe method with a list of topics
<https://kafka.apache.org/0110/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#subscribe(java.util.Collection,%20org.apache.kafka.clients.consumer.ConsumerRebalanceListener)>,
it is mentioned that topic subscription is not incremental. Does the same
apply for pattern-based subscriptions
<https://kafka.apache.org/0110/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#subscribe(java.util.regex.Pattern,%20org.apache.kafka.clients.consumer.ConsumerRebalanceListener)>
?

As an example, take the following scenario:
Step 1: consumer.subscribe(list("A","B","C"))

// Now we subscribe to topic D and no longer care about C
Step 2: consumer.subscribe(list("A","B","D"))

What happens in this scenario with pattern-based subscription?
Are all topics from Step 1 unsubscribed and then all Step 2 topics are
subscribed?

Thank you and best regards,

Pedro Cardoso

Research Data Engineer

pedro.card...@feedzai.com




[image: Follow Feedzai on Facebook.] <https://www.facebook.com/Feedzai/>[image:
Follow Feedzai on Twitter!] <https://twitter.com/feedzai>[image: Connect
with Feedzai on LinkedIn!] <https://www.linkedin.com/company/feedzai/>
<https://feedzai.com/>[image: Feedzai in Forbes Fintech 50!]
<https://www.forbes.com/fintech/list/>

-- 
The content of this email is confidential and 
intended for the recipient 
specified in message only. It is strictly 
prohibited to share any part of 
this message with any third party, 
without a written consent of the 
sender. If you received this message by
 mistake, please reply to this 
message and follow with its deletion, so 
that we can ensure such a mistake 
does not occur in the future.

Reply via email to