I have an issue, and I'm not sure what is the cause. After upgrade to spring boot 3.2 my app fails kafka test. I'm using:
spring-cloud-starter-contract-verifier
.mavenBom "org.springframework.cloud:spring-cloud-dependencies:2023.0.0
.id "org.springframework.boot" version "3.2.0"
id "io.spring.dependency-management" version "1.1.4"
It seems like there is no longer MessageVerifierReceiver
implementation of org.springframework.cloud.contract.verifier.messaging.kafka.KafkaStubMessages
which was handling those contract tests before. Now it resolves and uses bean: org.springframework.cloud.contract.verifier.messaging.integration.SpringIntegrationStubMessages
so it tries to resolve a bean with the name of the topic, and of course it fails. Do you guys have some idea what to check? Where should I look what might be wrong? Maybe there is some dependency missing, which before was not needed, but they deleted that implementation now and it needs to be added? Does anybody know about this? @MarcinGrzejszczak
It was deleted in commit: fa51d6a076be8c5dc620ea6e226ad6c87dc2c0ac Maybe by a mistake?
The answer is in the migration guide, which I've missed. Here it is: https://github.com/spring-cloud/spring-cloud-contract/wiki/Spring-Cloud-Contract-4.0-Migration-Guide#removing-support-for-mocked-amqp-oob-amqp-and-oob-kafka
Migration path Before:
You were using the stubbed AMQP or Kafka Stub Runner features.
After:
You need to set up your broker for the tests (e.g. via Testcontainers) You need to setup the MesssageVerifierSender (consumer) or > MessageVerifierReceiver (producer) beans where you will define how you are > actually sending and receiving messages