-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
EmbeddedKafkaCustomizer ignores adminTimeout in EmbeddedKafka annotation #3658
Comments
Confirmed as a bug. It feels like the |
artembilan
added a commit
to artembilan/spring-kafka
that referenced
this issue
Dec 12, 2024
…ution Fixes: spring-projects#3658 Issue link: spring-projects#3658 When `@EmbeddedKafka` is used with Spring context, the `adminTimeout` is not resolved. Apparently when `adminTimeout` was introduced, it was covered only by the `EmbeddedKafkaCondition`. * Extract `EmbeddedKafkaBrokerFactory` to encapsulate an `EmbeddedKafkaBroker` creation logic (including the mentioned `adminTimeout`) * Replace the logic in the `EmbeddedKafkaCondition` and `EmbeddedKafkaContextCustomizer` with that new `EmbeddedKafkaBrokerFactory`, essentially, introducing a single place of truth. * Pull `adminTimeout(int)` property to the `EmbeddedKafkaBroker` interface, making the logic in the `EmbeddedKafkaBrokerFactory` simpler * Add `adminTimeout` attribute verification into tests for condition, as well as Spring-based **Auto-cherry-pick to `3.2.x`**
artembilan
added a commit
that referenced
this issue
Dec 12, 2024
Fixes: #3658 Issue link: #3658 When `@EmbeddedKafka` is used with Spring context, the `adminTimeout` is not resolved. Apparently when `adminTimeout` was introduced, it was covered only by the `EmbeddedKafkaCondition`. * Extract `EmbeddedKafkaBrokerFactory` to encapsulate an `EmbeddedKafkaBroker` creation logic (including the mentioned `adminTimeout`) * Replace the logic in the `EmbeddedKafkaCondition` and `EmbeddedKafkaContextCustomizer` with that new `EmbeddedKafkaBrokerFactory`, essentially, introducing a single place of truth. * Pull `adminTimeout(int)` property to the `EmbeddedKafkaBroker` interface, making the logic in the `EmbeddedKafkaBrokerFactory` simpler * Add `adminTimeout` attribute verification into tests for condition, as well as Spring-based # Conflicts: # spring-kafka-test/src/main/java/org/springframework/kafka/test/context/EmbeddedKafkaContextCustomizer.java # spring-kafka-test/src/test/java/org/springframework/kafka/test/context/EmbeddedKafkaContextCustomizerTests.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In what version(s) of Spring for Apache Kafka are you seeing this issue? 3.2.5
When using the @embeddedkafka annotation with a list of topics, it will occasionally timeout on a slow build pipeline with the following exception
Checking in the debugger, I see that the admin timeout is set to the default 10 seconds.
Setting the adminTimeout attribute in the EmbeddedKafka annotation has no effect.
To Reproduce
Use the EmbeddedKafka annotation with the adminTimeout attribute set to something other than the default 10s.
Use a debugger and set a breakpoint in EmbeddedKafkaZKBroker.createTopics
Look at the adminTimeout property - it will be 10 seconds
Expected behavior
I believe EmbeddedKafkaContextCustomizer should call
embeddedKafkaBroker.setAdminTimeout(embeddedKafka.adminTimeout())
before calling embeddedKafkaBroker.afterPropertiesSet()
The text was updated successfully, but these errors were encountered: