@Singleton @Requires(env={"test","dev"}) @Requires(classes={kafka.server.KafkaServer.class,org.I0Itec.zkclient.ZkClient.class,kafka.utils.TestUtils.class,org.apache.kafka.test.TestUtils.class}) @Requires(property="kafka.embedded.enabled") public class KafkaEmbedded extends java.lang.Object implements io.micronaut.context.event.BeanCreatedEventListener<AbstractKafkaConfiguration>, java.lang.AutoCloseable
Constructor and Description |
---|
KafkaEmbedded(KafkaEmbeddedConfiguration embeddedConfiguration)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.util.Optional<kafka.server.KafkaServer> |
getKafkaServer()
Return the configured Kafka server is it was configured.
|
java.util.Optional<kafka.utils.ZkUtils> |
getZkUtils()
Returns the Zookeeper tools if they are available.
|
AbstractKafkaConfiguration |
onCreated(io.micronaut.context.event.BeanCreatedEvent<AbstractKafkaConfiguration> event) |
public KafkaEmbedded(KafkaEmbeddedConfiguration embeddedConfiguration)
embeddedConfiguration
- The KafkaEmbeddedConfiguration
public AbstractKafkaConfiguration onCreated(io.micronaut.context.event.BeanCreatedEvent<AbstractKafkaConfiguration> event)
onCreated
in interface io.micronaut.context.event.BeanCreatedEventListener<AbstractKafkaConfiguration>
@PreDestroy public void close()
close
in interface java.lang.AutoCloseable
public java.util.Optional<kafka.server.KafkaServer> getKafkaServer()
KafkaServer
public java.util.Optional<kafka.utils.ZkUtils> getZkUtils()