Description
The TestChannelBinder is initialized in spring context during tests even though it was never configured to be. This issue is there since 4.1.1 (we upgraded from spring cloud 2023.0.0 to 2023.0.1).
The docs clearly say, that you have to add the TestChannelBinderConfiguration in order to activate the TestChannelBinder. In an integration test where we wanted to test with an EmbeddedKafka (or a local one), we were not able to make our consumer connect to our topics. We found out that the TestChannelBinder ist exposed and used, which was why we could not consume any messages.
To Reproduce
Steps to reproduce the behavior:
We have setup an example project which is able to reproduce the issue: https://github.com/Akkjon/kafka-bug-demo
- clone the example project
- check if you have a local instance of kafka on port 9092 or use the embedded Kafka in the test class uncomment in Line 21 to use the embedded Kafka
- run
mvn clean test and see that the test will fail
- change the version of spring cloud from
2023.0.1 back to 2023.0.0
- run
mvn clean test again and see the tests succeeding
Version of the framework
Spring Boot 3.2.4,
Spring Cloud 2023.0.1,
JDK 21
Expected behavior
Since we did not include the TestChannelBinderConfiguration in the test class (nor anywhere in the code), we would expect the KafkaMessageChannelBinder to be used.
@Akkjon
Description
The
TestChannelBinderis initialized in spring context during tests even though it was never configured to be. This issue is there since4.1.1(we upgraded from spring cloud2023.0.0to2023.0.1).The docs clearly say, that you have to add the
TestChannelBinderConfigurationin order to activate theTestChannelBinder. In an integration test where we wanted to test with an EmbeddedKafka (or a local one), we were not able to make our consumer connect to our topics. We found out that theTestChannelBinderist exposed and used, which was why we could not consume any messages.To Reproduce
Steps to reproduce the behavior:
We have setup an example project which is able to reproduce the issue: https://github.com/Akkjon/kafka-bug-demo
mvn clean testand see that the test will fail2023.0.1back to2023.0.0mvn clean testagain and see the tests succeedingVersion of the framework
Spring Boot 3.2.4,
Spring Cloud 2023.0.1,
JDK 21
Expected behavior
Since we did not include the
TestChannelBinderConfigurationin the test class (nor anywhere in the code), we would expect theKafkaMessageChannelBinderto be used.@Akkjon