Class BasicProducerConfigBuilder
- java.lang.Object
-
- com.adaptris.kafka.BasicProducerConfigBuilder
-
- All Implemented Interfaces:
ConfigBuilder
,ProducerConfigBuilder
@Deprecated public class BasicProducerConfigBuilder extends java.lang.Object implements ProducerConfigBuilder
Deprecated.since 3.8.0 when using aKafkaConnection
; has no meaning.Basic implementation ofProducerConfigBuilder
.Only "high" importance properties from the Apache Kafka Producer Config Documentation are exposed; all other properties are left as default. The
key.serializer
property is fixed to be aStringSerializer
; and thevalue.serializer
property is always anAdaptrisMessageSerializer
.In the adapter configuration file this class is aliased as kafka-basic-producer-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 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 BasicProducerConfigBuilder()
Deprecated.BasicProducerConfigBuilder(java.lang.String bootstrapServers)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
build(ConfigBuilder.KeyFilter filter)
Deprecated.Build a configuration with a filter applied to the config names.ConfigBuilder.Acks
getAcks()
Deprecated.java.lang.String
getBootstrapServers()
Deprecated.java.lang.Long
getBufferMemory()
Deprecated.ConfigBuilder.CompressionType
getCompressionType()
Deprecated.java.lang.Integer
getRetries()
Deprecated.void
setAcks(ConfigBuilder.Acks a)
Deprecated.Set theacks
property.void
setBootstrapServers(java.lang.String s)
Deprecated.Set thebootstrap.servers
property.void
setBufferMemory(java.lang.Long m)
Deprecated.Set thebuffer.memory
property.void
setCompressionType(ConfigBuilder.CompressionType t)
Deprecated.Set thecompression.type
property.void
setRetries(java.lang.Integer i)
Deprecated.Set theretries
property.-
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.ProducerConfigBuilder
build
-
-
-
-
Method Detail
-
build
public java.util.Map<java.lang.String,java.lang.Object> build(ConfigBuilder.KeyFilter filter) throws CoreException
Deprecated.Description copied from interface:ConfigBuilder
Build a configuration with a filter applied to the config names.- Specified by:
build
in interfaceConfigBuilder
- Parameters:
filter
- the keys to keep.- Returns:
- the configuration
- Throws:
CoreException
- wrapping any underlying exception.- See Also:
ConfigDefinition
-
getBootstrapServers
public java.lang.String getBootstrapServers()
Deprecated.
-
setBootstrapServers
public void setBootstrapServers(java.lang.String s)
Deprecated.Set thebootstrap.servers
property.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:
s
- the bootstrap servers
-
getBufferMemory
public java.lang.Long getBufferMemory()
Deprecated.
-
setBufferMemory
public void setBufferMemory(java.lang.Long m)
Deprecated.Set thebuffer.memory
property.The total bytes of memory the producer can use to buffer records waiting to be sent to the server. If records are sent faster than they can be delivered to the server the producer will either block or throw an exception based on the preference specified by block.on.buffer.full ({code block.on.buffer.full} defaults to false, so an exception will be thrown).
This setting should correspond roughly to the total memory the producer will use, but is not a hard bound since not all memory the producer uses is used for buffering. Some additional memory will be used for compression (if compression is enabled) as well as for maintaining in-flight requests.
- Parameters:
m
- the buffer memory; default is 33554432L if not specified.
-
getCompressionType
public ConfigBuilder.CompressionType getCompressionType()
Deprecated.
-
setCompressionType
public void setCompressionType(ConfigBuilder.CompressionType t)
Deprecated.Set thecompression.type
property.The compression type for all data generated by the producer. The default is none (i.e. no compression). Valid values are none, gzip, snappy, or lz4. Compression is of full batches of data, so the efficacy of batching will also impact the compression ratio (more batching means better compression).
- Parameters:
t
- the compression type; default isConfigBuilder.CompressionType.none
if not specified.
-
getRetries
public java.lang.Integer getRetries()
Deprecated.
-
setRetries
public void setRetries(java.lang.Integer i)
Deprecated.Set theretries
property.Setting a value greater than zero will cause the client to resend any record whose send fails with a potentially transient error. Note that this retry is no different than if the client resent the record upon receiving the error. Allowing retries will potentially change the ordering of records because if two records are sent to a single partition, and the first fails and is retried but the second succeeds, then the second record may appear first.
- Parameters:
i
- the number of retries, default is 0 if not specified.
-
getAcks
public ConfigBuilder.Acks getAcks()
Deprecated.
-
setAcks
public void setAcks(ConfigBuilder.Acks a)
Deprecated.Set theacks
property.This specifies number of acknowledgments the producer requires the leader to have received before considering a request complete
- Parameters:
a
- the number of acks; default isConfigBuilder.Acks.all
if not specified for the strongest available guarantee.
-
-