79805932

Date: 2025-10-31 15:21:35
Score: 0.5
Natty:
Report link

Have you tired to change ConfluentKafkaContainer by KafkaContainer?

import org.testcontainers.containers.KafkaContainer;

@Container
@ServiceConnection
static KafkaContainer kafka = new KafkaContainer(
    DockerImageName.parse("confluentinc/cp-kafka:7.7.0")
);

By switching to the base KafkaContainer, Spring Boot's KafkaContainerConnectionDetailsFactory will execute, read the container's getBootstrapServers() method, and correctly configure the spring.kafka.bootstrap-servers property for you.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Max