Class BasicConsumerConfigBuilder
- java.lang.Object
-
- com.adaptris.kafka.ConfigBuilderImpl
-
- com.adaptris.kafka.BasicConsumerConfigBuilder
-
- All Implemented Interfaces:
ConfigBuilder,ConsumerConfigBuilder
@ComponentProfile(summary="Basic implementation of a Kafka consumer config builder", tag="builder,kafka", since="3.6.6") public class BasicConsumerConfigBuilder extends ConfigBuilderImpl implements ConsumerConfigBuilderBasic implementation ofConsumerConfigBuilder.Only "high" importance properties from the Apache Kafka Consumer Config Documentation are exposed; all other properties are left as default. The
key.serializerproperty is fixed to be aStringSerializer; and thevalue.serializerproperty is always anAdaptrisMessageSerializer.In the adapter configuration file this class is aliased as kafka-basic-consumer-config which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.adaptris.kafka.ConfigBuilder
ConfigBuilder.Acks, ConfigBuilder.CompressionType, ConfigBuilder.KeyFilter
-
-
Field Summary
-
Fields inherited from class com.adaptris.kafka.ConfigBuilderImpl
log
-
Fields inherited from interface com.adaptris.kafka.ConfigBuilder
DEFAULT_KEY_DESERIALIZER, DEFAULT_KEY_SERIALIZER, DEFAULT_VALUE_DESERIALIZER, DEFAULT_VALUE_SERIALIZER, KEY_DESERIALIZER_FACTORY_CONFIG
-
-
Constructor Summary
Constructors Constructor Description BasicConsumerConfigBuilder()BasicConsumerConfigBuilder(java.lang.String bootstrapServers)BasicConsumerConfigBuilder(java.lang.String bootstrapServers, java.lang.String groupId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>build(ConfigBuilder.KeyFilter filter)Build a configuration with a filter applied to the config names.@NonNull java.lang.StringgetBootstrapServers()Set thebootstrap.serversproperty.java.lang.StringgetGroupId()Set thegroup.idproperty.voidsetBootstrapServers(@NonNull java.lang.String bootstrapServers)Set thebootstrap.serversproperty.voidsetGroupId(java.lang.String groupId)Set thegroup.idproperty.-
Methods inherited from class com.adaptris.kafka.ConfigBuilderImpl
addEntry
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.kafka.ConsumerConfigBuilder
build
-
-
-
-
Constructor Detail
-
BasicConsumerConfigBuilder
public BasicConsumerConfigBuilder()
-
BasicConsumerConfigBuilder
public BasicConsumerConfigBuilder(java.lang.String bootstrapServers)
-
BasicConsumerConfigBuilder
public BasicConsumerConfigBuilder(java.lang.String bootstrapServers, java.lang.String groupId)
-
-
Method Detail
-
build
public java.util.Map<java.lang.String,java.lang.Object> build(ConfigBuilder.KeyFilter filter) throws CoreException
Description copied from interface:ConfigBuilderBuild a configuration with a filter applied to the config names.- Specified by:
buildin interfaceConfigBuilder- Parameters:
filter- the keys to keep.- Returns:
- the configuration
- Throws:
CoreException- wrapping any underlying exception.- See Also:
ConfigDefinition
-
getBootstrapServers
@NonNull public @NonNull java.lang.String getBootstrapServers()
Set thebootstrap.serversproperty.A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The client will make use of all servers irrespective of which servers are specified here for bootstrapping; this list only impacts the initial hosts used to discover the full set of servers. This list should be in the form
host1:port1,host2:port2,..... Since these servers are just used for the initial connection to discover the full cluster membership (which may change dynamically), this list need not contain the full set of servers (you may want more than one, though, in case a server is down).
-
setBootstrapServers
public void setBootstrapServers(@NonNull @NonNull java.lang.String bootstrapServers)Set thebootstrap.serversproperty.A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The client will make use of all servers irrespective of which servers are specified here for bootstrapping; this list only impacts the initial hosts used to discover the full set of servers. This list should be in the form
host1:port1,host2:port2,..... Since these servers are just used for the initial connection to discover the full cluster membership (which may change dynamically), this list need not contain the full set of servers (you may want more than one, though, in case a server is down).- Parameters:
bootstrapServers- the bootstrap servers
-
getGroupId
public java.lang.String getGroupId()
Set thegroup.idproperty.A unique string that identifies the consumer group this consumer belongs to. This property is required if the consumer uses either the group management functionality by using subscribe(topic) or the Kafka-based offset management strategy.
-
setGroupId
public void setGroupId(java.lang.String groupId)
Set thegroup.idproperty.A unique string that identifies the consumer group this consumer belongs to. This property is required if the consumer uses either the group management functionality by using subscribe(topic) or the Kafka-based offset management strategy.
- Parameters:
groupId- the groupId to set
-
-