注释类型 EnableKafkaTest
-
@Target({TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Documented @Inherited @EmbeddedKafka @Import(KafkaTestConfiguration.class) public @interface EnableKafkaTest
Enable Kafka Test- 从以下版本开始:
- 1.0.0
- 作者:
- Mercy
- 另请参阅:
EmbeddedKafka
-
-
可选元素概要
可选元素 修饰符和类型 可选元素 说明 java.lang.String[]
brokerProperties
Properties in form key=value that should be added to the broker config before runs.java.lang.String
brokerPropertiesLocation
SpringResource
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.
-
-
-
-
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}
-
-
-
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 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[] 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
SpringResource
url specifying the location of properties that should be added to the broker config. ThebrokerPropertiesLocation
url and the properties themselves may contain placeholders that are resolved during initialization. Properties specified bybrokerProperties()
will override properties found inbrokerPropertiesLocation
.- 返回:
- a
Resource
url specifying the location of properties to add - 另请参阅:
brokerProperties()
,EmbeddedKafkaBroker.brokerProperties(java.util.Map)
- 默认值:
- ""
-
-