Annotation Type EnableKafkaTest

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] brokerProperties
      Properties in form key=value that should be added to the broker config before runs.
      java.lang.String brokerPropertiesLocation
      Spring Resource url specifying the location of properties that should be added to the broker config.
      int brokers  
      boolean controlledShutdown  
      int partitions  
      int[] ports
      Set explicit ports on which the kafka brokers will listen.
      java.lang.String[] topics
      Topics that should be created Topics may contain property placeholders, e.g.
    • Element Detail

      • brokers

        @AliasFor(value="value",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        int brokers
        Returns:
        the number of brokers
        Default:
        1
      • controlledShutdown

        @AliasFor(value="controlledShutdown",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        boolean controlledShutdown
        Returns:
        passed into kafka.utils.TestUtils.createBrokerConfig().
        Default:
        false
      • ports

        @AliasFor(value="ports",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        int[] ports
        Set explicit ports on which the kafka brokers will listen. Useful when running an embedded broker that you want to access from other processes. A port must be provided for each instance, which means the number of ports must match the value of the count attribute.
        Returns:
        ports for brokers.
        Since:
        2.2.4
        Default:
        {9092}
      • partitions

        @AliasFor(value="partitions",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        int partitions
        Returns:
        partitions per topic
        Default:
        1
      • topics

        @AliasFor(value="topics",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        java.lang.String[] topics
        Topics that should be created Topics may contain property placeholders, e.g. topics = "${kafka.topic.one:topicOne}" The topics will be created with partitions() partitions; to provision other topics with other partition counts call the addTopics(NewTopic... topics) method on the autowired broker.
        Returns:
        the topics to create
        Default:
        {}
      • brokerProperties

        @AliasFor(value="brokerProperties",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        java.lang.String[] brokerProperties
        Properties in form key=value that should be added to the broker config before runs. Properties may contain property placeholders, e.g. delete.topic.enable=${topic.delete:true}.
        Returns:
        the properties to add
        See Also:
        brokerPropertiesLocation(), EmbeddedKafkaBroker.brokerProperties(java.util.Map)
        Default:
        {"listeners = PLAINTEXT://127.0.0.1:9092", "auto.create.topics.enable = true"}
      • brokerPropertiesLocation

        @AliasFor(value="brokerPropertiesLocation",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        java.lang.String brokerPropertiesLocation
        Spring Resource url specifying the location of properties that should be added to the broker config. The brokerPropertiesLocation url and the properties themselves may contain placeholders that are resolved during initialization. Properties specified by brokerProperties() will override properties found in brokerPropertiesLocation.
        Returns:
        a Resource url specifying the location of properties to add
        See Also:
        brokerProperties(), EmbeddedKafkaBroker.brokerProperties(java.util.Map)
        Default:
        ""