注释类型 EnableKafkaTest
-
@Target({TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Documented @Inherited @EmbeddedKafka @Import(KafkaTestConfiguration.class) public @interface EnableKafkaTestEnable Kafka Test- 从以下版本开始:
- 1.0.0
- 作者:
- Mercy
- 另请参阅:
EmbeddedKafka
-
-
可选元素概要
可选元素 修饰符和类型 可选元素 说明 java.lang.String[]brokerPropertiesProperties in form key=value that should be added to the broker config before runs.java.lang.StringbrokerPropertiesLocationSpringResourceurl specifying the location of properties that should be added to the broker config.intbrokersbooleancontrolledShutdownintpartitionsint[]portsSet explicit ports on which the kafka brokers will listen.java.lang.String[]topicsTopics that should be created Topics may contain property placeholders, e.g.
-
-
-
-
ports
@AliasFor(value="ports", annotation=org.springframework.kafka.test.context.EmbeddedKafka.class) int[] portsSet 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}
-
-
-
topics
@AliasFor(value="topics", annotation=org.springframework.kafka.test.context.EmbeddedKafka.class) java.lang.String[] topicsTopics that should be created Topics may contain property placeholders, e.g.topics = "${kafka.topic.one:topicOne}"The topics will be created withpartitions()partitions; to provision other topics with other partition counts call theaddTopics(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[] brokerPropertiesProperties 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 brokerPropertiesLocationSpringResourceurl specifying the location of properties that should be added to the broker config. ThebrokerPropertiesLocationurl and the properties themselves may contain placeholders that are resolved during initialization. Properties specified bybrokerProperties()will override properties found inbrokerPropertiesLocation.- 返回:
- a
Resourceurl specifying the location of properties to add - 另请参阅:
brokerProperties(),EmbeddedKafkaBroker.brokerProperties(java.util.Map)
- 默认值:
- ""
-
-