Skip to content

Documentation typo - Class names clashing - @EmbeddedKafka Annotation  #3701

@gcoppex

Description

@gcoppex

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

3.3.1 documentation

Bug Description

The java code snippet in the @EmbeddedKafka Annotation section has a confusing class name. The test configuration class name clashes with the KafkaStreamsConfiguration class name. I propose to rename it to TestKafkaStreamsConfiguration (see below).

The documentation should have something like:

@Configuration
    @EnableKafkaStreams
    public static class TestKafkaStreamsConfiguration {

        @Value("${" + EmbeddedKafkaBroker.SPRING_EMBEDDED_KAFKA_BROKERS + "}")
        private String brokerAddresses;

        @Bean(name = KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_CONFIG_BEAN_NAME)
        public KafkaStreamsConfiguration kStreamsConfigs() {
            Map<String, Object> props = new HashMap<>();
            props.put(StreamsConfig.APPLICATION_ID_CONFIG, "testStreams");
            props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, this.brokerAddresses);
            return new KafkaStreamsConfiguration(props);
        }

    }
``

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions