简体   繁体   中英

kafka efficient way to ignore self produced messages

i just started learning kafka. I have an application whose multiple instances can run.

each instance has producer and consumer. each instance request data by sending message using producer API and other's are supposed to receive the message through consumer API.

now because there is only one topic on which data is being exchange and each instance is producer and consumer for the same topic, the same instance gets the self created message. this is kind of expected behavior.

My question: What is the efficient way to ignore the self created messages on the given application instance?

I am using c++ librdkafka library on linux box.

也许您可以将应用程序ID(作为生产者应用程序的ID)嵌入到您的消息中,并在传递时检查该消息,如果该ID与接收应用程序的ID相匹配,则将其忽略。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM