Package io.microsphere.spring.test.kafka
Annotation Type EnableKafkaTest
-
@Target({TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Documented @Inherited @EmbeddedKafka @Import(KafkaTestConfiguration.class) public @interface EnableKafkaTest
Enable Kafka Test- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
EmbeddedKafka
-
-
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
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.- Returns:
- ports for brokers.
- Since:
- 2.2.4
- Default:
- {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.- 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
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
.- Returns:
- a
Resource
url specifying the location of properties to add - See Also:
brokerProperties()
,EmbeddedKafkaBroker.brokerProperties(java.util.Map)
- Default:
- ""
-
-