Package org.sdase.commons.server.kafka
Class KafkaBundle.Builder<T extends io.dropwizard.core.Configuration>
java.lang.Object
org.sdase.commons.server.kafka.KafkaBundle.Builder<T>
- All Implemented Interfaces:
KafkaBundle.FinalBuilder<T>
,KafkaBundle.InitialBuilder
- Enclosing class:
- KafkaBundle<C extends io.dropwizard.core.Configuration>
public static class KafkaBundle.Builder<T extends io.dropwizard.core.Configuration>
extends Object
implements KafkaBundle.InitialBuilder, KafkaBundle.FinalBuilder<T>
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
<C extends io.dropwizard.core.Configuration>
KafkaBundle.FinalBuilder<C>withConfigurationProvider
(KafkaConfigurationProvider<C> configurationProvider) withHealthCheckName
(String name) Defines a custom health check name for this kafka bundle.Disables the health check for Kafka.
-
Method Details
-
withoutHealthCheck
Description copied from interface:KafkaBundle.FinalBuilder
Disables the health check for Kafka. By disabling the health check the service can stay healthy even if the connection to Kafka is disrupted, if Kafka is not essential to the functionality. However, disabling it still registers an external health check to be able to monitor the connection.- Specified by:
withoutHealthCheck
in interfaceKafkaBundle.FinalBuilder<T extends io.dropwizard.core.Configuration>
- Returns:
- the same builder instance
-
withHealthCheckName
Description copied from interface:KafkaBundle.FinalBuilder
Defines a custom health check name for this kafka bundle. Defining a custom name is only needed and should only be set, if multipleKafkaBundle
s are used for multiple brokers to create unique names.An external health check, created when
KafkaBundle.FinalBuilder.withoutHealthCheck()
is configured, uses "kafkaConnectionExternal" as default and a regular health check uses "kafkaConnection" as default.- Specified by:
withHealthCheckName
in interfaceKafkaBundle.FinalBuilder<T extends io.dropwizard.core.Configuration>
- Parameters:
name
- the name of the health check- Returns:
- the same builder instance
-
build
- Specified by:
build
in interfaceKafkaBundle.FinalBuilder<T extends io.dropwizard.core.Configuration>
-
withConfigurationProvider
public <C extends io.dropwizard.core.Configuration> KafkaBundle.FinalBuilder<C> withConfigurationProvider(KafkaConfigurationProvider<C> configurationProvider) - Specified by:
withConfigurationProvider
in interfaceKafkaBundle.InitialBuilder
- Type Parameters:
C
- the type of the applications configuration class- Parameters:
configurationProvider
- the method reference that provides the @KafkaConfiguration
from the applications configurations class- Returns:
- the same builder instance
-