Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with rdkafka_example when auto.create.topics.enable=true in kafka8 #22

Closed
opsmekanix opened this issue Oct 10, 2013 · 3 comments
Closed
Assignees

Comments

@opsmekanix
Copy link

Kafka 8 offers a feature where new topics are automatically created by the broker if a producer attempts to send messages to a non-existent topic. When 'auto.create.topics.enable=true' is set in Kafka 8, messages sent by the 'rdkafka_example producer' get black holed by the broker. FWIW: messages sent to existing topics when 'auto.create.topics.enable=true' works just fine.

To reproduce this condition, add 'auto.create.topics.enable=true' to the server.properties file and start the broker. You should find that kafka-consumer-producer.sh triggers the broker to create the new topics and works as advertised. But something goes wrong with rdkafka_example.

Thanks for continuing to maintain this project and looking into this issue.

-- Adam

@edenhill
Copy link
Contributor

librdkafka currently waits for a topic to show up in the broker metadata mapping before producing a message for it.
I'll change it to attempt producing a single message to a random broker for unknown topics.

@ghost ghost assigned edenhill Oct 10, 2013
edenhill added a commit that referenced this issue Oct 10, 2013
This requires "auto.create.topics.enable=true" to be configured on the
brokers.

The automatic topic creation trigger (a topic-specific metadata request)
is performed every second, as well as immediately when a new topic is added
if at least one broker is up.
@edenhill
Copy link
Contributor

This issue should now be fixed.

If the topic-object is created (with rd_kafka_topic_new()) when at least one broker is up the broker-side topic creation will be immediate, otherwise the topic will be auto-created on the broker within at most 1 second.
Produced messages will be queued and sent to the broker when the topic has been created.

Could you verify this on your end and then close the issue?

Please update your master branch, rebuild librdkafka and do a 'make clean all' in examples/, then try your test again.

Thanks

@opsmekanix
Copy link
Author

The new patch seems to be working as I could see the new topic being created. Thanks for the quick turn around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants