Skip to content

EmbeddedKafkaKraftBroker.kafkaPorts(int... ports) is ignored #2916

@zyro23

Description

@zyro23

First of all, thanks for the new EmbeddedKafkaBroker abstraction and the KRaft impl.!

In what version(s) of Spring for Apache Kafka are you seeing this issue?

3.1.0

Describe the bug

EmbeddedKafkaKraftBroker.kafkaPorts(int... ports) sets the kafkaPorts array but it seems that is never used?

ref.: https://github.com/spring-projects/spring-kafka/blob/v3.1.0/spring-kafka-test/src/main/java/org/springframework/kafka/test/EmbeddedKafkaKraftBroker.java#L148-L160

To Reproduce

EmbeddedKafkaKraftBroker broker = new EmbeddedKafkaKraftBroker(1,1)
    .kafkaPorts(9092);

-> still uses random port.

Expected behavior

The EmbeddedKafkaKraftBroker actually uses the specified port(s).

Sample

ping me if you think a sample is helpful here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions