-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Description
The rd_kafka_topic_t object doesn't really have any use to the application and looking at librdkafka language bindings most of them implement a produce() API that takes a name rather than an object, which forces those bindings to maintain their own name -> topic_t map.
New Producer APIs should be made that takes a topic name instead, alternatively a simple fire-and-forget interface that maps a topic name to a topic_t, e.g:
rd_kafka_produce(rd_kafka_topic("mytopic"), ...);
rd_kafka_topic_t *rd_kafka_topic(const char *topic)
could construct a tiny ..topic_t container on the stack that only contains a magic value (to identify it as a tiny container) and the topic name, and librdkafka will use that to look up or create the internal topic_t object.