How to run multiple kafka consumers on the same box independent of each other?

前端 未结 3 715
太阳男子
太阳男子 2020-12-11 20:27

I have two Kafka consumer ConsumerA and ConsumerB. I want to run these two kafka consumers independent of each other on the same machine. There is

3条回答
  •  一整个雨季
    2020-12-11 20:43

    A quick suggestion, apologies if you know about it already. Class level variables are never thread safe. If you need to have a different Properties object for every thread, better declare them at the method level and provide them as parameter to other methods where you need to access Properties object.

提交回复
热议问题