Hi all,
I have an app that I’ve deployed to a Kubernetes cluster, the app connects to a Kafka instance and reads messages from 1 specific group and 1 topic.
I want to have this a bit more resistant and I want to increase the number of replicas in Kubernetes and set it to 3 or 5 for example.
But I’m not sure if this is going to be OK for the Kafka messages… has anyone done this before and did you have any issues having multiple pod replicas connecting to the same Kafka topic?
Any suggestions would be appreciated!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Caveat: I don’t have too much experience with Kafka, so better to double check what I’m about to say.
My understanding is that Kafka is specifically designed for this particular scenario. Multiple clients can add messages and multiple clients can consume them.
I think these points in the documentation are pretty helpful:
https://kafka.apache.org/uses#uses_messaging
I also found the following quote here: https://docs.microsoft.com/en-us/azure/hdinsight/kafka/apache-kafka-producer-consumer-api
If you create multiple consumer instances using the same group ID, they’ll load balance reading from the topic.
Still, even if the system you’re using supports your requirements, you might be accidentally misconfiguring it or something like that. So I highly recommend testing your code as much as possible.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.