Reputation: 454
I noticed that Kafka Producer uses tcp protocol.
Is there any way to fix the source ports of the multiple Kafka producers in advance? Or at least, Is there any way I can track the source port of Kafka producer? I need to track the bandwidth of kafka producers and consumers. And need to set up traffic control (tc) rules according to these ports.
Upvotes: 0
Views: 749
Reputation: 1
To achieve this you can use something called a socket_cb() in librdKafka library (I was using 2.0.2 version). To achieve this u need to set
Rdkadka::Conf* globalConf = Rdkafka::Conf::create(Rdkafka::Conf::CONF_GLOBAL)
globalConf->set("socket_cb", static_castRdKafka::EventCb*(this), errstr);
And now rewrite the socket_cb() function
this should solve the above issue.
Upvotes: 0
Reputation: 191904
Producers don't open inbound sockets, so there is no binding of a "source port".
The only network information you must provide is bootstrap.servers
Upvotes: 1