The variables globalConfig and topicConfPtr in Publisher::ensureSetup() leak
I suspect they should both be deleted once they have been used on the calls to RdKafka::Producer::create etc. The docs say
"conf is an optional object that will be used instead of the default configuration. The conf object is reusable after this call."
Dan S. Camper I'm not sure what the recommended way of deleting the objects is though, so leave it to you. I suspect the same goes for Consumer::ensureSetup