注释类型 EnableKafkaTest

    • 可选元素概要

      可选元素 
      修饰符和类型 可选元素 说明
      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.
    • 元素详细资料

      • brokers

        @AliasFor(value="value",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        int brokers
        返回:
        the number of brokers
        默认值:
        1
      • controlledShutdown

        @AliasFor(value="controlledShutdown",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        boolean controlledShutdown
        返回:
        passed into kafka.utils.TestUtils.createBrokerConfig().
        默认值:
        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.
        返回:
        ports for brokers.
        从以下版本开始:
        2.2.4
        默认值:
        {9092}
      • partitions

        @AliasFor(value="partitions",
                  annotation=org.springframework.kafka.test.context.EmbeddedKafka.class)
        int partitions
        返回:
        partitions per topic
        默认值:
        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.
        返回:
        the topics to create
        默认值:
        {}
      • 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}.
        返回:
        the properties to add
        另请参阅:
        brokerPropertiesLocation(), EmbeddedKafkaBroker.brokerProperties(java.util.Map)
        默认值:
        {"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.
        返回:
        a Resource url specifying the location of properties to add
        另请参阅:
        brokerProperties(), EmbeddedKafkaBroker.brokerProperties(java.util.Map)
        默认值:
        ""