[
https://issues.apache.org/jira/browse/KAFKA-4238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15584849#comment-15584849
]
Florian Witteler commented on KAFKA-4238:
-----------------------------------------
That's exactly what I thought. Maybe you could implement that.
As I said - it's only test code. So I'd also be happy with a blocking call that
waits until the topic is ready. Can you tell me how you would implement that?
I already tried to query for the topic metadata myself using the AdminUtils.
But I haven't found a way to reliably get the info "topic doesn't exist yet".
> consumer-subscription not working, when accessing a newly created topic
> immediately after its creation with the AdminUtils
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: KAFKA-4238
> URL: https://issues.apache.org/jira/browse/KAFKA-4238
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 0.10.0.0, 0.10.0.1
> Reporter: Florian Witteler
>
> I created a test-project to reproduce the bug.
> https://github.com/FloWi/kafka-topic-creation-bug
> We use a docker container that creates a fresh topic before a testsuite gets
> executed (see {{trait FreshKafkaTopics}}). That trait uses the AdminUtils to
> create the topic.
> If we access the newly created topic directly after its creation, the
> subscriber is broken. It sometimes works though (<5%), so it seems to be a
> race-condition.
> If I put a {{Thread.sleep(1000)}} after the topic-creation, everything's fine
> though.
> So, the problem is twofold:
> - {{AdminUtils.createTopic}} should block until the topic-creation is
> completed
> - {{new KafkaConsumer[String,
> String](props).subscribe(util.Arrays.asList(topic))}} should throw an
> exception, when the topic is "not ready"
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)