@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Inherited
public @interface EmbeddedKafka
KafkaEmbedded
bean with the KafkaEmbedded.BEAN_NAME
bean name.
The typical usage of this annotation is like:
@RunWith(SpringRunner.class) @EmbeddedKafka public class MyKafkaTests { @Autowired private KafkaEmbedded kafkaEmbedded; @Value("${spring.embedded.kafka.brokers}") private String brokerAddresses; }
KafkaEmbedded
Modifier and Type | Optional Element and 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. |
boolean |
controlledShutdown |
int |
count |
int |
partitions |
java.lang.String[] |
topics |
int |
value |
@AliasFor(value="count") public abstract int value
public abstract boolean controlledShutdown
kafka.utils.TestUtils.createBrokerConfig()
.public abstract java.lang.String[] brokerProperties
delete.topic.enable=${topic.delete:true}
.brokerPropertiesLocation()
,
KafkaEmbedded.brokerProperties(java.util.Map)
public abstract java.lang.String brokerPropertiesLocation
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
.Resource
url specifying the location of properties to addbrokerProperties()
,
KafkaEmbedded.brokerProperties(java.util.Map)