Alert - This might not be the solution for all since there are many possibilities for an "Unknown topic or partition error". Try to confirm the below configurations :
- The topic name spelled correctly and the topic exists.
- The consume() method can work with multiple topics. So if you have assigned the list of topics as comma separate values in a single string - make sure you convert it to List before passing to consume. This solved my issue.