问题
I am where i have two Kafka Listener components, each listening to a different topic and expecting a different payload. My question is, can i use the same client-id for both or does it have to be different? If the client-id has to be different i am wanting to understand a use-case where the client-id can be effectively used.
回答1:
According to the docs:
An id string to pass to the server when making requests. The purpose of this is to be able to track the source of requests beyond just ip/port by allowing a logical application name to be included in server-side request logging.
So, technically you really can have the same value for different consumers/producers
来源:https://stackoverflow.com/questions/45173712/spring-kafka-consumer-client-id-configuration