Skip to content

Remove the need for rd_kafka_topic_t in application #908

@edenhill

Description

@edenhill

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions