Package org.apache.camel.component.kafka
Class KafkaConfiguration
- java.lang.Object
-
- org.apache.camel.component.kafka.KafkaConfiguration
-
-
Constructor Summary
Constructors Constructor Description KafkaConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KafkaConfiguration
copy()
Returns a copy of this configurationProperties
createConsumerProperties()
Properties
createProducerProperties()
Map<String,Object>
getAdditionalProperties()
Boolean
getAutoCommitEnable()
Integer
getAutoCommitIntervalMs()
String
getAutoCommitOnStop()
String
getAutoOffsetReset()
String
getBrokers()
Integer
getBufferMemorySize()
Boolean
getCheckCrcs()
String
getClientId()
String
getCompressionCodec()
Integer
getConnectionMaxIdleMs()
Integer
getConsumerRequestTimeoutMs()
int
getConsumersCount()
int
getConsumerStreams()
Integer
getFetchMaxBytes()
The maximum amount of data the server should return for a fetch request This is not an absolute maximum, if the first message in the first non-empty partition of the fetch is larger than this value, the message will still be returned to ensure that the consumer can make progress.Integer
getFetchMinBytes()
Integer
getFetchWaitMaxMs()
String
getGroupId()
org.apache.camel.spi.HeaderFilterStrategy
getHeaderFilterStrategy()
Integer
getHeartbeatIntervalMs()
String
getInterceptorClasses()
KafkaHeaderDeserializer
getKafkaHeaderDeserializer()
KafkaHeaderSerializer
getKafkaHeaderSerializer()
Integer
getKerberosBeforeReloginMinTime()
String
getKerberosInitCmd()
String
getKerberosPrincipalToLocalRules()
Double
getKerberosRenewJitter()
Double
getKerberosRenewWindowFactor()
String
getKey()
String
getKeyDeserializer()
String
getKeySerializerClass()
Integer
getLingerMs()
Integer
getMaxBlockMs()
Integer
getMaxInFlightRequest()
Integer
getMaxPartitionFetchBytes()
Long
getMaxPollIntervalMs()
Integer
getMaxPollRecords()
Integer
getMaxRequestSize()
Integer
getMetadataMaxAgeMs()
String
getMetricReporters()
Integer
getMetricsSampleWindowMs()
Integer
getNoOfMetricsSample()
org.apache.camel.spi.StateRepository<String,String>
getOffsetRepository()
String
getPartitionAssignor()
String
getPartitioner()
Integer
getPartitionKey()
Long
getPollTimeoutMs()
Integer
getProducerBatchSize()
Integer
getQueueBufferingMaxMessages()
Integer
getReceiveBufferBytes()
Integer
getReconnectBackoffMaxMs()
Integer
getReconnectBackoffMs()
String
getRequestRequiredAcks()
Integer
getRequestTimeoutMs()
Integer
getRetries()
Integer
getRetryBackoffMs()
String
getSaslJaasConfig()
String
getSaslKerberosServiceName()
String
getSaslMechanism()
String
getSchemaRegistryURL()
String
getSecurityProtocol()
String
getSeekTo()
Integer
getSendBufferBytes()
String
getSerializerClass()
Integer
getSessionTimeoutMs()
int
getShutdownTimeout()
String
getSslCipherSuites()
org.apache.camel.support.jsse.SSLContextParameters
getSslContextParameters()
String
getSslEnabledProtocols()
String
getSslEndpointAlgorithm()
String
getSslKeymanagerAlgorithm()
String
getSslKeyPassword()
String
getSslKeystoreLocation()
String
getSslKeystorePassword()
String
getSslKeystoreType()
String
getSslProtocol()
String
getSslProvider()
String
getSslTrustmanagerAlgorithm()
String
getSslTruststoreLocation()
String
getSslTruststorePassword()
String
getSslTruststoreType()
String
getTopic()
String
getValueDeserializer()
ExecutorService
getWorkerPool()
Integer
getWorkerPoolCoreSize()
Integer
getWorkerPoolMaxSize()
boolean
isAllowManualCommit()
boolean
isAutoCommitEnable()
boolean
isBreakOnFirstError()
boolean
isEnableIdempotence()
boolean
isRecordMetadata()
boolean
isSpecificAvroReader()
boolean
isTopicIsPattern()
void
setAdditionalProperties(Map<String,Object> additionalProperties)
Sets additional properties for either kafka consumer or kafka producer in case they can't be set directly on the camel configurations (e.g: new Kafka properties that are not reflected yet in Camel configurations), the properties have to be prefixed with `additionalProperties.`.void
setAllowManualCommit(boolean allowManualCommit)
Whether to allow doing manual commits viaKafkaManualCommit
.void
setAutoCommitEnable(Boolean autoCommitEnable)
If true, periodically commit to ZooKeeper the offset of messages already fetched by the consumer.void
setAutoCommitIntervalMs(Integer autoCommitIntervalMs)
The frequency in ms that the consumer offsets are committed to zookeeper.void
setAutoCommitOnStop(String autoCommitOnStop)
Whether to perform an explicit auto commit when the consumer stops to ensure the broker has a commit from the last consumed message.void
setAutoOffsetReset(String autoOffsetReset)
What to do when there is no initial offset in ZooKeeper or if an offset is out of range: earliest : automatically reset the offset to the earliest offset latest : automatically reset the offset to the latest offset fail: throw exception to the consumervoid
setBreakOnFirstError(boolean breakOnFirstError)
This options controls what happens when a consumer is processing an exchange and it fails.void
setBrokers(String brokers)
URL of the Kafka brokers to use.void
setBufferMemorySize(Integer bufferMemorySize)
The total bytes of memory the producer can use to buffer records waiting to be sent to the server.void
setCheckCrcs(Boolean checkCrcs)
Automatically check the CRC32 of the records consumed.void
setClientId(String clientId)
The client id is a user-specified string sent in each request to help trace calls.void
setCompressionCodec(String compressionCodec)
This parameter allows you to specify the compression codec for all data generated by this producer.void
setConnectionMaxIdleMs(Integer connectionMaxIdleMs)
Close idle connections after the number of milliseconds specified by this config.void
setConsumerRequestTimeoutMs(Integer consumerRequestTimeoutMs)
The configuration controls the maximum amount of time the client will wait for the response of a request.void
setConsumersCount(int consumersCount)
The number of consumers that connect to kafka servervoid
setConsumerStreams(int consumerStreams)
Number of concurrent consumers on the consumervoid
setEnableIdempotence(boolean enableIdempotence)
If set to 'true' the producer will ensure that exactly one copy of each message is written in the stream.void
setFetchMaxBytes(Integer fetchMaxBytes)
void
setFetchMinBytes(Integer fetchMinBytes)
The minimum amount of data the server should return for a fetch request.void
setFetchWaitMaxMs(Integer fetchWaitMaxMs)
The maximum amount of time the server will block before answering the fetch request if there isn't sufficient data to immediately satisfy fetch.min.bytesvoid
setGroupId(String groupId)
A string that uniquely identifies the group of consumer processes to which this consumer belongs.void
setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
To use a custom HeaderFilterStrategy to filter header to and from Camel message.void
setHeartbeatIntervalMs(Integer heartbeatIntervalMs)
The expected time between heartbeats to the consumer coordinator when using Kafka's group management facilities.void
setInterceptorClasses(String interceptorClasses)
Sets interceptors for producer or consumers.void
setKafkaHeaderDeserializer(KafkaHeaderDeserializer kafkaHeaderDeserializer)
Sets custom KafkaHeaderDeserializer for deserialization kafka headers values to camel headers values.void
setKafkaHeaderSerializer(KafkaHeaderSerializer kafkaHeaderSerializer)
Sets custom KafkaHeaderDeserializer for serialization camel headers values to kafka headers values.void
setKerberosBeforeReloginMinTime(Integer kerberosBeforeReloginMinTime)
Login thread sleep time between refresh attempts.void
setKerberosInitCmd(String kerberosInitCmd)
Kerberos kinit command path.void
setKerberosPrincipalToLocalRules(String kerberosPrincipalToLocalRules)
A list of rules for mapping from principal names to short names (typically operating system usernames).void
setKerberosRenewJitter(Double kerberosRenewJitter)
Percentage of random jitter added to the renewal time.void
setKerberosRenewWindowFactor(Double kerberosRenewWindowFactor)
Login thread will sleep until the specified window factor of time from last refresh to ticket's expiry has been reached, at which time it will try to renew the ticket.void
setKey(String key)
The record key (or null if no key is specified).void
setKeyDeserializer(String keyDeserializer)
Deserializer class for key that implements the Deserializer interface.void
setKeySerializerClass(String keySerializerClass)
The serializer class for keys (defaults to the same as for messages if nothing is given).void
setLingerMs(Integer lingerMs)
The producer groups together any records that arrive in between request transmissions into a single batched request.void
setMaxBlockMs(Integer maxBlockMs)
The configuration controls how long sending to kafka will block.void
setMaxInFlightRequest(Integer maxInFlightRequest)
The maximum number of unacknowledged requests the client will send on a single connection before blocking.void
setMaxPartitionFetchBytes(Integer maxPartitionFetchBytes)
The maximum amount of data per-partition the server will return.void
setMaxPollIntervalMs(Long maxPollIntervalMs)
The maximum delay between invocations of poll() when using consumer group management.void
setMaxPollRecords(Integer maxPollRecords)
The maximum number of records returned in a single call to poll()void
setMaxRequestSize(Integer maxRequestSize)
The maximum size of a request.void
setMetadataMaxAgeMs(Integer metadataMaxAgeMs)
The period of time in milliseconds after which we force a refresh of metadata even if we haven't seen any partition leadership changes to proactively discover any new brokers or partitions.void
setMetricReporters(String metricReporters)
A list of classes to use as metrics reporters.void
setMetricsSampleWindowMs(Integer metricsSampleWindowMs)
The number of samples maintained to compute metrics.void
setNoOfMetricsSample(Integer noOfMetricsSample)
The number of samples maintained to compute metrics.void
setOffsetRepository(org.apache.camel.spi.StateRepository<String,String> offsetRepository)
The offset repository to use in order to locally store the offset of each partition of the topic.void
setPartitionAssignor(String partitionAssignor)
The class name of the partition assignment strategy that the client will use to distribute partition ownership amongst consumer instances when group management is usedvoid
setPartitioner(String partitioner)
The partitioner class for partitioning messages amongst sub-topics.void
setPartitionKey(Integer partitionKey)
The partition to which the record will be sent (or null if no partition was specified).void
setPollTimeoutMs(Long pollTimeoutMs)
The timeout used when polling the KafkaConsumer.void
setProducerBatchSize(Integer producerBatchSize)
The producer will attempt to batch records together into fewer requests whenever multiple records are being sent to the same partition.void
setQueueBufferingMaxMessages(Integer queueBufferingMaxMessages)
The maximum number of unsent messages that can be queued up the producer when using async mode before either the producer must be blocked or data must be dropped.void
setReceiveBufferBytes(Integer receiveBufferBytes)
The size of the TCP receive buffer (SO_RCVBUF) to use when reading data.void
setReconnectBackoffMaxMs(Integer reconnectBackoffMaxMs)
The maximum amount of time in milliseconds to wait when reconnecting to a broker that has repeatedly failed to connect.void
setReconnectBackoffMs(Integer reconnectBackoffMs)
The amount of time to wait before attempting to reconnect to a given host.void
setRecordMetadata(boolean recordMetadata)
Whether the producer should store theRecordMetadata
results from sending to Kafka.void
setRequestRequiredAcks(String requestRequiredAcks)
The number of acknowledgments the producer requires the leader to have received before considering a request complete.void
setRequestTimeoutMs(Integer requestTimeoutMs)
The amount of time the broker will wait trying to meet the request.required.acks requirement before sending back an error to the client.void
setRetries(Integer retries)
Setting a value greater than zero will cause the client to resend any record whose send fails with a potentially transient error.void
setRetryBackoffMs(Integer retryBackoffMs)
Before each retry, the producer refreshes the metadata of relevant topics to see if a new leader has been elected.void
setSaslJaasConfig(String saslMechanism)
Expose the kafka sasl.jaas.config parameter Example: org.apache.kafka.common.security.plain.PlainLoginModule required username="USERNAME" password="PASSWORD";void
setSaslKerberosServiceName(String saslKerberosServiceName)
The Kerberos principal name that Kafka runs as.void
setSaslMechanism(String saslMechanism)
The Simple Authentication and Security Layer (SASL) Mechanism used.void
setSchemaRegistryURL(String schemaRegistryURL)
URL of the Confluent Platform schema registry servers to use.void
setSecurityProtocol(String securityProtocol)
Protocol used to communicate with brokers.void
setSeekTo(String seekTo)
Set if KafkaConsumer will read from beginning or end on startup: beginning : read from beginning end : read from end This is replacing the earlier property seekToBeginningvoid
setSendBufferBytes(Integer sendBufferBytes)
Socket write buffer sizevoid
setSerializerClass(String serializerClass)
The serializer class for messages.void
setSessionTimeoutMs(Integer sessionTimeoutMs)
The timeout used to detect failures when using Kafka's group management facilities.void
setShutdownTimeout(int shutdownTimeout)
Timeout in milli seconds to wait gracefully for the consumer or producer to shutdown and terminate its worker threads.void
setSpecificAvroReader(boolean specificAvroReader)
This enables the use of a specific Avro reader for use with the Confluent Platform schema registry and the io.confluent.kafka.serializers.KafkaAvroDeserializer.void
setSslCipherSuites(String sslCipherSuites)
A list of cipher suites.void
setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
SSL configuration using a CamelSSLContextParameters
object.void
setSslEnabledProtocols(String sslEnabledProtocols)
The list of protocols enabled for SSL connections.void
setSslEndpointAlgorithm(String sslEndpointAlgorithm)
The endpoint identification algorithm to validate server hostname using server certificate.void
setSslKeymanagerAlgorithm(String sslKeymanagerAlgorithm)
The algorithm used by key manager factory for SSL connections.void
setSslKeyPassword(String sslKeyPassword)
The password of the private key in the key store file.void
setSslKeystoreLocation(String sslKeystoreLocation)
The location of the key store file.void
setSslKeystorePassword(String sslKeystorePassword)
The store password for the key store file.This is optional for client and only needed if ssl.keystore.location is configured.void
setSslKeystoreType(String sslKeystoreType)
The file format of the key store file.void
setSslProtocol(String sslProtocol)
The SSL protocol used to generate the SSLContext.void
setSslProvider(String sslProvider)
The name of the security provider used for SSL connections.void
setSslTrustmanagerAlgorithm(String sslTrustmanagerAlgorithm)
The algorithm used by trust manager factory for SSL connections.void
setSslTruststoreLocation(String sslTruststoreLocation)
The location of the trust store file.void
setSslTruststorePassword(String sslTruststorePassword)
The password for the trust store file.void
setSslTruststoreType(String sslTruststoreType)
The file format of the trust store file.void
setTopic(String topic)
Name of the topic to use.void
setTopicIsPattern(boolean topicIsPattern)
Whether the topic is a pattern (regular expression).void
setValueDeserializer(String valueDeserializer)
Deserializer class for value that implements the Deserializer interface.void
setWorkerPool(ExecutorService workerPool)
To use a custom worker pool for continue routingExchange
after kafka server has acknowledge the message that was sent to it fromKafkaProducer
using asynchronous non-blocking processing.void
setWorkerPoolCoreSize(Integer workerPoolCoreSize)
Number of core threads for the worker pool for continue routingExchange
after kafka server has acknowledge the message that was sent to it fromKafkaProducer
using asynchronous non-blocking processing.void
setWorkerPoolMaxSize(Integer workerPoolMaxSize)
Maximum number of threads for the worker pool for continue routingExchange
after kafka server has acknowledge the message that was sent to it fromKafkaProducer
using asynchronous non-blocking processing.
-
-
-
Method Detail
-
copy
public KafkaConfiguration copy()
Returns a copy of this configuration
-
createProducerProperties
public Properties createProducerProperties()
-
createConsumerProperties
public Properties createConsumerProperties()
-
isTopicIsPattern
public boolean isTopicIsPattern()
-
setTopicIsPattern
public void setTopicIsPattern(boolean topicIsPattern)
Whether the topic is a pattern (regular expression). This can be used to subscribe to dynamic number of topics matching the pattern.
-
getGroupId
public String getGroupId()
-
setGroupId
public void setGroupId(String groupId)
A string that uniquely identifies the group of consumer processes to which this consumer belongs. By setting the same group id multiple processes indicate that they are all part of the same consumer group. This option is required for consumers.
-
getPartitioner
public String getPartitioner()
-
setPartitioner
public void setPartitioner(String partitioner)
The partitioner class for partitioning messages amongst sub-topics. The default partitioner is based on the hash of the key.
-
getTopic
public String getTopic()
-
setTopic
public void setTopic(String topic)
Name of the topic to use. On the consumer you can use comma to separate multiple topics. A producer can only send a message to a single topic.
-
getConsumerStreams
public int getConsumerStreams()
-
setConsumerStreams
public void setConsumerStreams(int consumerStreams)
Number of concurrent consumers on the consumer
-
getConsumersCount
public int getConsumersCount()
-
setConsumersCount
public void setConsumersCount(int consumersCount)
The number of consumers that connect to kafka server
-
getClientId
public String getClientId()
-
setClientId
public void setClientId(String clientId)
The client id is a user-specified string sent in each request to help trace calls. It should logically identify the application making the request.
-
isAutoCommitEnable
public boolean isAutoCommitEnable()
-
getAutoCommitEnable
public Boolean getAutoCommitEnable()
-
setAutoCommitEnable
public void setAutoCommitEnable(Boolean autoCommitEnable)
If true, periodically commit to ZooKeeper the offset of messages already fetched by the consumer. This committed offset will be used when the process fails as the position from which the new consumer will begin.
-
isAllowManualCommit
public boolean isAllowManualCommit()
-
setAllowManualCommit
public void setAllowManualCommit(boolean allowManualCommit)
Whether to allow doing manual commits viaKafkaManualCommit
. If this option is enabled then an instance ofKafkaManualCommit
is stored on theExchange
message header, which allows end users to access this API and perform manual offset commits via the Kafka consumer.
-
getShutdownTimeout
public int getShutdownTimeout()
-
setShutdownTimeout
public void setShutdownTimeout(int shutdownTimeout)
Timeout in milli seconds to wait gracefully for the consumer or producer to shutdown and terminate its worker threads.
-
getOffsetRepository
public org.apache.camel.spi.StateRepository<String,String> getOffsetRepository()
-
setOffsetRepository
public void setOffsetRepository(org.apache.camel.spi.StateRepository<String,String> offsetRepository)
The offset repository to use in order to locally store the offset of each partition of the topic. Defining one will disable the autocommit.
-
getAutoCommitIntervalMs
public Integer getAutoCommitIntervalMs()
-
setAutoCommitIntervalMs
public void setAutoCommitIntervalMs(Integer autoCommitIntervalMs)
The frequency in ms that the consumer offsets are committed to zookeeper.
-
getFetchMinBytes
public Integer getFetchMinBytes()
-
setFetchMinBytes
public void setFetchMinBytes(Integer fetchMinBytes)
The minimum amount of data the server should return for a fetch request. If insufficient data is available the request will wait for that much data to accumulate before answering the request.
-
getFetchMaxBytes
public Integer getFetchMaxBytes()
The maximum amount of data the server should return for a fetch request This is not an absolute maximum, if the first message in the first non-empty partition of the fetch is larger than this value, the message will still be returned to ensure that the consumer can make progress. The maximum message size accepted by the broker is defined via message.max.bytes (broker config) or max.message.bytes (topic config). Note that the consumer performs multiple fetches in parallel.
-
setFetchMaxBytes
public void setFetchMaxBytes(Integer fetchMaxBytes)
-
getFetchWaitMaxMs
public Integer getFetchWaitMaxMs()
-
setFetchWaitMaxMs
public void setFetchWaitMaxMs(Integer fetchWaitMaxMs)
The maximum amount of time the server will block before answering the fetch request if there isn't sufficient data to immediately satisfy fetch.min.bytes
-
getAutoOffsetReset
public String getAutoOffsetReset()
-
setAutoOffsetReset
public void setAutoOffsetReset(String autoOffsetReset)
What to do when there is no initial offset in ZooKeeper or if an offset is out of range: earliest : automatically reset the offset to the earliest offset latest : automatically reset the offset to the latest offset fail: throw exception to the consumer
-
getAutoCommitOnStop
public String getAutoCommitOnStop()
-
setAutoCommitOnStop
public void setAutoCommitOnStop(String autoCommitOnStop)
Whether to perform an explicit auto commit when the consumer stops to ensure the broker has a commit from the last consumed message. This requires the option autoCommitEnable is turned on. The possible values are: sync, async, or none. And sync is the default value.
-
isBreakOnFirstError
public boolean isBreakOnFirstError()
-
setBreakOnFirstError
public void setBreakOnFirstError(boolean breakOnFirstError)
This options controls what happens when a consumer is processing an exchange and it fails. If the option is false then the consumer continues to the next message and processes it. If the option is true then the consumer breaks out, and will seek back to offset of the message that caused a failure, and then re-attempt to process this message. However this can lead to endless processing of the same message if its bound to fail every time, eg a poison message. Therefore its recommended to deal with that for example by using Camel's error handler.
-
getBrokers
public String getBrokers()
-
setBrokers
public void setBrokers(String brokers)
URL of the Kafka brokers to use. The format is host1:port1,host2:port2, and the list can be a subset of brokers or a VIP pointing to a subset of brokers. This option is known as bootstrap.servers in the Kafka documentation.
-
getSchemaRegistryURL
public String getSchemaRegistryURL()
-
setSchemaRegistryURL
public void setSchemaRegistryURL(String schemaRegistryURL)
URL of the Confluent Platform schema registry servers to use. The format is host1:port1,host2:port2. This is known as schema.registry.url in the Confluent Platform documentation. This option is only available in the Confluent Platform (not standard Apache Kafka)
-
isSpecificAvroReader
public boolean isSpecificAvroReader()
-
setSpecificAvroReader
public void setSpecificAvroReader(boolean specificAvroReader)
This enables the use of a specific Avro reader for use with the Confluent Platform schema registry and the io.confluent.kafka.serializers.KafkaAvroDeserializer. This option is only available in the Confluent Platform (not standard Apache Kafka)
-
getCompressionCodec
public String getCompressionCodec()
-
setCompressionCodec
public void setCompressionCodec(String compressionCodec)
This parameter allows you to specify the compression codec for all data generated by this producer. Valid values are "none", "gzip" and "snappy".
-
getRetryBackoffMs
public Integer getRetryBackoffMs()
-
setRetryBackoffMs
public void setRetryBackoffMs(Integer retryBackoffMs)
Before each retry, the producer refreshes the metadata of relevant topics to see if a new leader has been elected. Since leader election takes a bit of time, this property specifies the amount of time that the producer waits before refreshing the metadata.
-
getSendBufferBytes
public Integer getSendBufferBytes()
-
setSendBufferBytes
public void setSendBufferBytes(Integer sendBufferBytes)
Socket write buffer size
-
getRequestTimeoutMs
public Integer getRequestTimeoutMs()
-
setRequestTimeoutMs
public void setRequestTimeoutMs(Integer requestTimeoutMs)
The amount of time the broker will wait trying to meet the request.required.acks requirement before sending back an error to the client.
-
getQueueBufferingMaxMessages
public Integer getQueueBufferingMaxMessages()
-
setQueueBufferingMaxMessages
public void setQueueBufferingMaxMessages(Integer queueBufferingMaxMessages)
The maximum number of unsent messages that can be queued up the producer when using async mode before either the producer must be blocked or data must be dropped.
-
getSerializerClass
public String getSerializerClass()
-
setSerializerClass
public void setSerializerClass(String serializerClass)
The serializer class for messages.
-
getKeySerializerClass
public String getKeySerializerClass()
-
setKeySerializerClass
public void setKeySerializerClass(String keySerializerClass)
The serializer class for keys (defaults to the same as for messages if nothing is given).
-
getKerberosInitCmd
public String getKerberosInitCmd()
-
setKerberosInitCmd
public void setKerberosInitCmd(String kerberosInitCmd)
Kerberos kinit command path. Default is /usr/bin/kinit
-
getKerberosBeforeReloginMinTime
public Integer getKerberosBeforeReloginMinTime()
-
setKerberosBeforeReloginMinTime
public void setKerberosBeforeReloginMinTime(Integer kerberosBeforeReloginMinTime)
Login thread sleep time between refresh attempts.
-
getKerberosRenewJitter
public Double getKerberosRenewJitter()
-
setKerberosRenewJitter
public void setKerberosRenewJitter(Double kerberosRenewJitter)
Percentage of random jitter added to the renewal time.
-
getKerberosRenewWindowFactor
public Double getKerberosRenewWindowFactor()
-
setKerberosRenewWindowFactor
public void setKerberosRenewWindowFactor(Double kerberosRenewWindowFactor)
Login thread will sleep until the specified window factor of time from last refresh to ticket's expiry has been reached, at which time it will try to renew the ticket.
-
getKerberosPrincipalToLocalRules
public String getKerberosPrincipalToLocalRules()
-
setKerberosPrincipalToLocalRules
public void setKerberosPrincipalToLocalRules(String kerberosPrincipalToLocalRules)
A list of rules for mapping from principal names to short names (typically operating system usernames). The rules are evaluated in order and the first rule that matches a principal name is used to map it to a short name. Any later rules in the list are ignored. By default, principal names of the form {username}/{hostname}@{REALM} are mapped to {username}. For more details on the format please see the security authorization and acls documentation.. Multiple values can be separated by comma
-
getSslCipherSuites
public String getSslCipherSuites()
-
setSslCipherSuites
public void setSslCipherSuites(String sslCipherSuites)
A list of cipher suites. This is a named combination of authentication, encryption, MAC and key exchange algorithm used to negotiate the security settings for a network connection using TLS or SSL network protocol.By default all the available cipher suites are supported.
-
getSslEndpointAlgorithm
public String getSslEndpointAlgorithm()
-
setSslEndpointAlgorithm
public void setSslEndpointAlgorithm(String sslEndpointAlgorithm)
The endpoint identification algorithm to validate server hostname using server certificate.
-
getSslKeymanagerAlgorithm
public String getSslKeymanagerAlgorithm()
-
setSslKeymanagerAlgorithm
public void setSslKeymanagerAlgorithm(String sslKeymanagerAlgorithm)
The algorithm used by key manager factory for SSL connections. Default value is the key manager factory algorithm configured for the Java Virtual Machine.
-
getSslTrustmanagerAlgorithm
public String getSslTrustmanagerAlgorithm()
-
setSslTrustmanagerAlgorithm
public void setSslTrustmanagerAlgorithm(String sslTrustmanagerAlgorithm)
The algorithm used by trust manager factory for SSL connections. Default value is the trust manager factory algorithm configured for the Java Virtual Machine.
-
getSslEnabledProtocols
public String getSslEnabledProtocols()
-
setSslEnabledProtocols
public void setSslEnabledProtocols(String sslEnabledProtocols)
The list of protocols enabled for SSL connections. TLSv1.2, TLSv1.1 and TLSv1 are enabled by default.
-
getSslKeystoreType
public String getSslKeystoreType()
-
setSslKeystoreType
public void setSslKeystoreType(String sslKeystoreType)
The file format of the key store file. This is optional for client. Default value is JKS
-
getSslProtocol
public String getSslProtocol()
-
setSslProtocol
public void setSslProtocol(String sslProtocol)
The SSL protocol used to generate the SSLContext. Default setting is TLS, which is fine for most cases. Allowed values in recent JVMs are TLS, TLSv1.1 and TLSv1.2. SSL, SSLv2 and SSLv3 may be supported in older JVMs, but their usage is discouraged due to known security vulnerabilities.
-
getSslProvider
public String getSslProvider()
-
setSslProvider
public void setSslProvider(String sslProvider)
The name of the security provider used for SSL connections. Default value is the default security provider of the JVM.
-
getSslTruststoreType
public String getSslTruststoreType()
-
setSslTruststoreType
public void setSslTruststoreType(String sslTruststoreType)
The file format of the trust store file. Default value is JKS.
-
getSaslKerberosServiceName
public String getSaslKerberosServiceName()
-
setSaslKerberosServiceName
public void setSaslKerberosServiceName(String saslKerberosServiceName)
The Kerberos principal name that Kafka runs as. This can be defined either in Kafka's JAAS config or in Kafka's config.
-
getSaslMechanism
public String getSaslMechanism()
-
setSaslMechanism
public void setSaslMechanism(String saslMechanism)
The Simple Authentication and Security Layer (SASL) Mechanism used. For the valid values see http://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml
-
getSaslJaasConfig
public String getSaslJaasConfig()
-
setSaslJaasConfig
public void setSaslJaasConfig(String saslMechanism)
Expose the kafka sasl.jaas.config parameter Example: org.apache.kafka.common.security.plain.PlainLoginModule required username="USERNAME" password="PASSWORD";
-
getSecurityProtocol
public String getSecurityProtocol()
-
setSecurityProtocol
public void setSecurityProtocol(String securityProtocol)
Protocol used to communicate with brokers. SASL_PLAINTEXT, PLAINTEXT and SSL are supported
-
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()
-
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
SSL configuration using a CamelSSLContextParameters
object. If configured it's applied before the other SSL endpoint parameters. NOTE: Kafka only supports loading keystore from file locations, so prefix the location with file: in the KeyStoreParameters.resource option.
-
getSslKeyPassword
public String getSslKeyPassword()
-
setSslKeyPassword
public void setSslKeyPassword(String sslKeyPassword)
The password of the private key in the key store file. This is optional for client.
-
getSslKeystoreLocation
public String getSslKeystoreLocation()
-
setSslKeystoreLocation
public void setSslKeystoreLocation(String sslKeystoreLocation)
The location of the key store file. This is optional for client and can be used for two-way authentication for client.
-
getSslKeystorePassword
public String getSslKeystorePassword()
-
setSslKeystorePassword
public void setSslKeystorePassword(String sslKeystorePassword)
The store password for the key store file.This is optional for client and only needed if ssl.keystore.location is configured.
-
getSslTruststoreLocation
public String getSslTruststoreLocation()
-
setSslTruststoreLocation
public void setSslTruststoreLocation(String sslTruststoreLocation)
The location of the trust store file.
-
getSslTruststorePassword
public String getSslTruststorePassword()
-
setSslTruststorePassword
public void setSslTruststorePassword(String sslTruststorePassword)
The password for the trust store file.
-
getBufferMemorySize
public Integer getBufferMemorySize()
-
setBufferMemorySize
public void setBufferMemorySize(Integer bufferMemorySize)
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.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.
-
getKey
public String getKey()
-
setKey
public void setKey(String key)
The record key (or null if no key is specified). If this option has been configured then it take precedence over headerKafkaConstants.KEY
-
getPartitionKey
public Integer getPartitionKey()
-
setPartitionKey
public void setPartitionKey(Integer partitionKey)
The partition to which the record will be sent (or null if no partition was specified). If this option has been configured then it take precedence over headerKafkaConstants.PARTITION_KEY
-
getRequestRequiredAcks
public String getRequestRequiredAcks()
-
setRequestRequiredAcks
public void setRequestRequiredAcks(String requestRequiredAcks)
The number of acknowledgments the producer requires the leader to have received before considering a request complete. This controls the durability of records that are sent. The following settings are common: acks=0 If set to zero then the producer will not wait for any acknowledgment from the server at all. The record will be immediately added to the socket buffer and considered sent. No guarantee can be made that the server has received the record in this case, and the retries configuration will not take effect (as the client won't generally know of any failures). The offset given back for each record will always be set to -1. acks=1 This will mean the leader will write the record to its local log but will respond without awaiting full acknowledgement from all followers. In this case should the leader fail immediately after acknowledging the record but before the followers have replicated it then the record will be lost. acks=all This means the leader will wait for the full set of in-sync replicas to acknowledge the record. This guarantees that the record will not be lost as long as at least one in-sync replica remains alive. This is the strongest available guarantee.
-
getRetries
public Integer getRetries()
-
setRetries
public void setRetries(Integer retries)
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.
-
getProducerBatchSize
public Integer getProducerBatchSize()
-
setProducerBatchSize
public void setProducerBatchSize(Integer producerBatchSize)
The producer will attempt to batch records together into fewer requests whenever multiple records are being sent to the same partition. This helps performance on both the client and the server. This configuration controls the default batch size in bytes. No attempt will be made to batch records larger than this size.Requests sent to brokers will contain multiple batches, one for each partition with data available to be sent.A small batch size will make batching less common and may reduce throughput (a batch size of zero will disable batching entirely). A very large batch size may use memory a bit more wastefully as we will always allocate a buffer of the specified batch size in anticipation of additional records.
-
getConnectionMaxIdleMs
public Integer getConnectionMaxIdleMs()
-
setConnectionMaxIdleMs
public void setConnectionMaxIdleMs(Integer connectionMaxIdleMs)
Close idle connections after the number of milliseconds specified by this config.
-
getLingerMs
public Integer getLingerMs()
-
setLingerMs
public void setLingerMs(Integer lingerMs)
The producer groups together any records that arrive in between request transmissions into a single batched request. Normally this occurs only under load when records arrive faster than they can be sent out. However in some circumstances the client may want to reduce the number of requests even under moderate load. This setting accomplishes this by adding a small amount of artificial delay that is, rather than immediately sending out a record the producer will wait for up to the given delay to allow other records to be sent so that the sends can be batched together. This can be thought of as analogous to Nagle's algorithm in TCP. This setting gives the upper bound on the delay for batching: once we get batch.size worth of records for a partition it will be sent immediately regardless of this setting, however if we have fewer than this many bytes accumulated for this partition we will 'linger' for the specified time waiting for more records to show up. This setting defaults to 0 (i.e. no delay). Setting linger.ms=5, for example, would have the effect of reducing the number of requests sent but would add up to 5ms of latency to records sent in the absense of load.
-
getMaxBlockMs
public Integer getMaxBlockMs()
-
setMaxBlockMs
public void setMaxBlockMs(Integer maxBlockMs)
The configuration controls how long sending to kafka will block. These methods can be blocked for multiple reasons. For e.g: buffer full, metadata unavailable.This configuration imposes maximum limit on the total time spent in fetching metadata, serialization of key and value, partitioning and allocation of buffer memory when doing a send(). In case of partitionsFor(), this configuration imposes a maximum time threshold on waiting for metadata
-
getMaxRequestSize
public Integer getMaxRequestSize()
-
setMaxRequestSize
public void setMaxRequestSize(Integer maxRequestSize)
The maximum size of a request. This is also effectively a cap on the maximum record size. Note that the server has its own cap on record size which may be different from this. This setting will limit the number of record batches the producer will send in a single request to avoid sending huge requests.
-
getReceiveBufferBytes
public Integer getReceiveBufferBytes()
-
setReceiveBufferBytes
public void setReceiveBufferBytes(Integer receiveBufferBytes)
The size of the TCP receive buffer (SO_RCVBUF) to use when reading data.
-
getMaxInFlightRequest
public Integer getMaxInFlightRequest()
-
setMaxInFlightRequest
public void setMaxInFlightRequest(Integer maxInFlightRequest)
The maximum number of unacknowledged requests the client will send on a single connection before blocking. Note that if this setting is set to be greater than 1 and there are failed sends, there is a risk of message re-ordering due to retries (i.e., if retries are enabled).
-
getMetadataMaxAgeMs
public Integer getMetadataMaxAgeMs()
-
setMetadataMaxAgeMs
public void setMetadataMaxAgeMs(Integer metadataMaxAgeMs)
The period of time in milliseconds after which we force a refresh of metadata even if we haven't seen any partition leadership changes to proactively discover any new brokers or partitions.
-
getMetricReporters
public String getMetricReporters()
-
setMetricReporters
public void setMetricReporters(String metricReporters)
A list of classes to use as metrics reporters. Implementing the MetricReporter interface allows plugging in classes that will be notified of new metric creation. The JmxReporter is always included to register JMX statistics.
-
getNoOfMetricsSample
public Integer getNoOfMetricsSample()
-
setNoOfMetricsSample
public void setNoOfMetricsSample(Integer noOfMetricsSample)
The number of samples maintained to compute metrics.
-
getMetricsSampleWindowMs
public Integer getMetricsSampleWindowMs()
-
setMetricsSampleWindowMs
public void setMetricsSampleWindowMs(Integer metricsSampleWindowMs)
The number of samples maintained to compute metrics.
-
getReconnectBackoffMs
public Integer getReconnectBackoffMs()
-
setReconnectBackoffMs
public void setReconnectBackoffMs(Integer reconnectBackoffMs)
The amount of time to wait before attempting to reconnect to a given host. This avoids repeatedly connecting to a host in a tight loop. This backoff applies to all requests sent by the consumer to the broker.
-
getHeartbeatIntervalMs
public Integer getHeartbeatIntervalMs()
-
setHeartbeatIntervalMs
public void setHeartbeatIntervalMs(Integer heartbeatIntervalMs)
The expected time between heartbeats to the consumer coordinator when using Kafka's group management facilities. Heartbeats are used to ensure that the consumer's session stays active and to facilitate rebalancing when new consumers join or leave the group. The value must be set lower than session.timeout.ms, but typically should be set no higher than 1/3 of that value. It can be adjusted even lower to control the expected time for normal rebalances.
-
getMaxPartitionFetchBytes
public Integer getMaxPartitionFetchBytes()
-
setMaxPartitionFetchBytes
public void setMaxPartitionFetchBytes(Integer maxPartitionFetchBytes)
The maximum amount of data per-partition the server will return. The maximum total memory used for a request will be #partitions * max.partition.fetch.bytes. This size must be at least as large as the maximum message size the server allows or else it is possible for the producer to send messages larger than the consumer can fetch. If that happens, the consumer can get stuck trying to fetch a large message on a certain partition.
-
getSessionTimeoutMs
public Integer getSessionTimeoutMs()
-
setSessionTimeoutMs
public void setSessionTimeoutMs(Integer sessionTimeoutMs)
The timeout used to detect failures when using Kafka's group management facilities.
-
getMaxPollRecords
public Integer getMaxPollRecords()
-
setMaxPollRecords
public void setMaxPollRecords(Integer maxPollRecords)
The maximum number of records returned in a single call to poll()
-
getPollTimeoutMs
public Long getPollTimeoutMs()
-
setPollTimeoutMs
public void setPollTimeoutMs(Long pollTimeoutMs)
The timeout used when polling the KafkaConsumer.
-
getMaxPollIntervalMs
public Long getMaxPollIntervalMs()
-
setMaxPollIntervalMs
public void setMaxPollIntervalMs(Long maxPollIntervalMs)
The maximum delay between invocations of poll() when using consumer group management. This places an upper bound on the amount of time that the consumer can be idle before fetching more records. If poll() is not called before expiration of this timeout, then the consumer is considered failed and the group will rebalance in order to reassign the partitions to another member.
-
getPartitionAssignor
public String getPartitionAssignor()
-
setPartitionAssignor
public void setPartitionAssignor(String partitionAssignor)
The class name of the partition assignment strategy that the client will use to distribute partition ownership amongst consumer instances when group management is used
-
getConsumerRequestTimeoutMs
public Integer getConsumerRequestTimeoutMs()
-
setConsumerRequestTimeoutMs
public void setConsumerRequestTimeoutMs(Integer consumerRequestTimeoutMs)
The configuration controls the maximum amount of time the client will wait for the response of a request. If the response is not received before the timeout elapses the client will resend the request if necessary or fail the request if retries are exhausted.
-
getCheckCrcs
public Boolean getCheckCrcs()
-
setCheckCrcs
public void setCheckCrcs(Boolean checkCrcs)
Automatically check the CRC32 of the records consumed. This ensures no on-the-wire or on-disk corruption to the messages occurred. This check adds some overhead, so it may be disabled in cases seeking extreme performance.
-
getKeyDeserializer
public String getKeyDeserializer()
-
setKeyDeserializer
public void setKeyDeserializer(String keyDeserializer)
Deserializer class for key that implements the Deserializer interface.
-
getValueDeserializer
public String getValueDeserializer()
-
setValueDeserializer
public void setValueDeserializer(String valueDeserializer)
Deserializer class for value that implements the Deserializer interface.
-
getSeekTo
public String getSeekTo()
-
setSeekTo
public void setSeekTo(String seekTo)
Set if KafkaConsumer will read from beginning or end on startup: beginning : read from beginning end : read from end This is replacing the earlier property seekToBeginning
-
getWorkerPool
public ExecutorService getWorkerPool()
-
setWorkerPool
public void setWorkerPool(ExecutorService workerPool)
To use a custom worker pool for continue routingExchange
after kafka server has acknowledge the message that was sent to it fromKafkaProducer
using asynchronous non-blocking processing. If using this option then you must handle the lifecycle of the thread pool to shut the pool down when no longer needed.
-
getWorkerPoolCoreSize
public Integer getWorkerPoolCoreSize()
-
setWorkerPoolCoreSize
public void setWorkerPoolCoreSize(Integer workerPoolCoreSize)
Number of core threads for the worker pool for continue routingExchange
after kafka server has acknowledge the message that was sent to it fromKafkaProducer
using asynchronous non-blocking processing.
-
getWorkerPoolMaxSize
public Integer getWorkerPoolMaxSize()
-
setWorkerPoolMaxSize
public void setWorkerPoolMaxSize(Integer workerPoolMaxSize)
Maximum number of threads for the worker pool for continue routingExchange
after kafka server has acknowledge the message that was sent to it fromKafkaProducer
using asynchronous non-blocking processing.
-
isRecordMetadata
public boolean isRecordMetadata()
-
setRecordMetadata
public void setRecordMetadata(boolean recordMetadata)
Whether the producer should store theRecordMetadata
results from sending to Kafka. The results are stored in aList
containing theRecordMetadata
metadata's. The list is stored on a header with the keyKafkaConstants.KAFKA_RECORDMETA
-
getInterceptorClasses
public String getInterceptorClasses()
-
setInterceptorClasses
public void setInterceptorClasses(String interceptorClasses)
Sets interceptors for producer or consumers. Producer interceptors have to be classes implementingProducerInterceptor
Consumer interceptors have to be classes implementingConsumerInterceptor
Note that if you use Producer interceptor on a consumer it will throw a class cast exception in runtime
-
isEnableIdempotence
public boolean isEnableIdempotence()
-
setEnableIdempotence
public void setEnableIdempotence(boolean enableIdempotence)
If set to 'true' the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer retries may write duplicates of the retried message in the stream. If set to true this option will require max.in.flight.requests.per.connection to be set to 1 and retries cannot be zero and additionally acks must be set to 'all'.
-
getReconnectBackoffMaxMs
public Integer getReconnectBackoffMaxMs()
-
setReconnectBackoffMaxMs
public void setReconnectBackoffMaxMs(Integer reconnectBackoffMaxMs)
The maximum amount of time in milliseconds to wait when reconnecting to a broker that has repeatedly failed to connect. If provided, the backoff per host will increase exponentially for each consecutive connection failure, up to this maximum. After calculating the backoff increase, 20% random jitter is added to avoid connection storms.
-
getHeaderFilterStrategy
public org.apache.camel.spi.HeaderFilterStrategy getHeaderFilterStrategy()
- Specified by:
getHeaderFilterStrategy
in interfaceorg.apache.camel.spi.HeaderFilterStrategyAware
-
setHeaderFilterStrategy
public void setHeaderFilterStrategy(org.apache.camel.spi.HeaderFilterStrategy headerFilterStrategy)
To use a custom HeaderFilterStrategy to filter header to and from Camel message.- Specified by:
setHeaderFilterStrategy
in interfaceorg.apache.camel.spi.HeaderFilterStrategyAware
-
getKafkaHeaderDeserializer
public KafkaHeaderDeserializer getKafkaHeaderDeserializer()
-
setKafkaHeaderDeserializer
public void setKafkaHeaderDeserializer(KafkaHeaderDeserializer kafkaHeaderDeserializer)
Sets custom KafkaHeaderDeserializer for deserialization kafka headers values to camel headers values.- Parameters:
kafkaHeaderDeserializer
- custom kafka header deserializer to be used
-
getKafkaHeaderSerializer
public KafkaHeaderSerializer getKafkaHeaderSerializer()
-
setKafkaHeaderSerializer
public void setKafkaHeaderSerializer(KafkaHeaderSerializer kafkaHeaderSerializer)
Sets custom KafkaHeaderDeserializer for serialization camel headers values to kafka headers values.- Parameters:
kafkaHeaderSerializer
- custom kafka header serializer to be used
-
setAdditionalProperties
public void setAdditionalProperties(Map<String,Object> additionalProperties)
Sets additional properties for either kafka consumer or kafka producer in case they can't be set directly on the camel configurations (e.g: new Kafka properties that are not reflected yet in Camel configurations), the properties have to be prefixed with `additionalProperties.`. E.g: `additionalProperties.transactional.id=12345&additionalProperties.schema.registry.url=http://localhost:8811/avro`
-
-