Kafka
Send and receive messages to/from an Apache Kafka broker.
What’s inside
-
Kafka component, URI syntax:
kafka:topic
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-kafka-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 140 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.kafka.additional-properties | 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. If the properties are set in the application.properties file, they must be prefixed with camel.component.kafka.additional-properties (camel.component.kafka-share.additional-properties for the Kafka Share component) followed by the property name enclosed in square brackets, for example the delivery.timeout.ms property in square brackets. When sslContextParameters is configured, additional properties whose names start with ssl. are ignored because that SSL context configures the complete TLS engine. This is a multi-value option with prefix: additionalProperties. | Object> | |
camel.component.kafka.allow-manual-commit | Whether to allow manual commits with KafkaManualCommit. If enabled, the consumer stores a KafkaManualCommit in the CamelKafkaManualCommit header of each exchange (in batching mode, the one of the last record), and the route calls its commit() method to commit the offset of the record. Disable autoCommitEnable too, otherwise the Kafka consumer also commits the offsets in the background. How commit() commits is set by kafkaManualCommitFactory. | false | Boolean |
camel.component.kafka.auto-commit-enable | Whether the Kafka consumer commits the offsets periodically in the background (enable.auto.commit), every autoCommitIntervalMs. Camel turns it off when offsetRepository is set or batching is enabled. When off, the offsets are committed by the route with allowManualCommit, by Camel to the offsetRepository, or by Camel after each batch in batching mode; otherwise no offsets are committed. | true | Boolean |
camel.component.kafka.auto-commit-interval-ms | The frequency in milliseconds that the consumer offsets are auto-committed to Kafka if autoCommitEnable is set to true. | 5000 | Integer |
camel.component.kafka.auto-offset-reset | Where a consumer group starts reading when it has no committed offset, or the committed offset is out of range. Valid values are: earliest (seek to the earliest available offset), latest (seek to the latest offset, the default), none (throw an exception if no previous offset is found), by_duration: followed by an ISO-8601 duration (e.g. by_duration:PT5M or by_duration:P1D; requires Kafka 4.0 or later). | latest | String |
camel.component.kafka.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.kafka.batch-with-individual-headers | When the producer sends each element of an Iterable or Iterator body as a record (see useIterator), whether the Kafka headers of the record of an element that is an Exchange or a Message are made from the headers of that element. If false, every record gets the headers of the message that holds the body. | false | Boolean |
camel.component.kafka.batching | Whether the consumer processes the records in batches instead of one exchange per record. The body of a batch exchange is a List with the exchanges of the records. A batch is processed when it has maxPollRecords records, when batchingIntervalMs has passed, or when a poll returns no records and pollTimeoutMs has passed since the batch was started. Batching turns off the Kafka auto commit: unless allowManualCommit or offsetRepository is set, Camel commits the offsets of a batch asynchronously when its exchange completes successfully. | false | Boolean |
camel.component.kafka.batching-interval-ms | In batching mode, the time in milliseconds after which an incomplete batch (fewer than maxPollRecords records) is processed. The check is done after each poll, so the batch is processed up to pollTimeoutMs later: with 10000 and the default pollTimeoutMs of 5000, an incomplete batch is processed after 10 to 15 seconds. If not set, an incomplete batch is processed only when a poll returns no records and pollTimeoutMs has passed since the batch was started. | Integer | |
camel.component.kafka.break-on-first-error | Whether the consumer stops at the first exchange that fails (an exception that the error handler did not handle) and consumes that record again. If false, the consumer logs the failure with the exceptionHandler and goes on with the next record. If true, Camel commits the offsets of the records before the failed record (with allowManualCommit, only when kafkaManualCommitFactory is DefaultKafkaManualCommitFactory or DefaultKafkaManualAsyncCommitFactory; without it, only with offsetRepository; otherwise nothing is committed), closes the Kafka consumer and creates a new one, which polls again from the committed offset: the failed record is consumed again, and so are the records after the last commit. A record that always fails is consumed again and again, so handle such errors with the Camel error handler. In batching mode, nothing is committed with allowManualCommit, and without it the failed batch is committed, so it is not consumed again. | false | Boolean |
camel.component.kafka.bridge-error-handler | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean |
camel.component.kafka.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. | String | |
camel.component.kafka.buffer-memory-size | 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 block for maxBlockMs after which it will fail with an exception. 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. | 33554432 | Integer |
camel.component.kafka.check-crcs | 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. | true | Boolean |
camel.component.kafka.client-id | 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. | String | |
camel.component.kafka.commit-timeout-ms | The maximum time, in milliseconds, that a synchronous commit (commitSync) waits for the broker: the commit() of KafkaManualCommit with the default or the DefaultKafkaManualCommitFactory, and the commit of breakOnFirstError with that factory. When it expires, the commit fails with org.apache.kafka.common.errors.TimeoutException. The option is a java.lang.Long type. | 5000 | Long |
camel.component.kafka.compression-codec | This parameter allows you to specify the compression codec for all data generated by this producer. Valid values are none, gzip, snappy, lz4 and zstd. | none | String |
camel.component.kafka.configuration | Allows to pre-configure the Kafka component with common options that the endpoints will reuse. The option is a org.apache.camel.component.kafka.KafkaConfiguration type. | KafkaConfiguration | |
camel.component.kafka.connection-max-idle-ms | Close idle connections after the number of milliseconds specified by this config. | 540000 | Integer |
camel.component.kafka.consumer-request-timeout-ms | 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 elapsed, the client will resend the request if necessary or fail the request if retries are exhausted. | 30000 | Integer |
camel.component.kafka.consumers-count | The number of Kafka consumers that the endpoint runs, each on its own thread with its own connection to the brokers. They are members of the same consumer group, so they share the partitions of the topic: the consumers beyond the number of partitions (counting the consumers of all the application instances) get no records. With groupInstanceId, each consumer gets its own group instance id. | 1 | Integer |
camel.component.kafka.create-consumer-backoff-interval | The delay in milliseconds between two attempts to create the Kafka consumer (see createConsumerBackoffMaxAttempts). | 5000 | Long |
camel.component.kafka.create-consumer-backoff-max-attempts | The maximum number of attempts to create and subscribe the Kafka consumer of a consumer thread (also when it is created again after a reconnect), after which Camel gives up and terminates that consumer thread. Creating the consumer fails both for temporary causes, such as a broker host name that cannot be resolved yet, and for lasting ones, such as an invalid configuration, and the Kafka client does not tell them apart. 0 (the default) or a negative value retries forever. To try again after Camel gave up, restart the route. | Integer | |
camel.component.kafka.delivery-timeout-ms | An upper bound on the time to report success or failure after a call to send() returns. This limits the total time that a record will be delayed prior to sending, the time to await acknowledgement from the broker (if expected), and the time allowed for retriable send failures. The producer may report failure to send a record earlier than this config if either an unrecoverable error is encountered, the retries have been exhausted, or the record is added to a batch which reached an earlier delivery expiration deadline. The value of this config should be greater than or equal to the sum of requestTimeoutMs and lingerMs. | 120000 | Integer |
camel.component.kafka.enable-idempotence | When set to 'true', the producer will ensure that exactly one copy of each message is written in the stream. If 'false', producer retries due to broker failures, etc., may write duplicates of the retried message in the stream. Note that enabling idempotence requires max.in.flight.requests.per.connection to be less than or equal to 5 (with message ordering preserved for any allowable value), retries to be greater than 0, and acks must be 'all'. Idempotence is enabled by default if no conflicting configurations are set. If conflicting configurations are set and idempotence is not explicitly enabled, idempotence is disabled. If idempotence is explicitly enabled and conflicting configurations are set, a ConfigException is thrown. | true | Boolean |
camel.component.kafka.enabled | Whether to enable auto configuration of the kafka component. This is enabled by default. | Boolean | |
camel.component.kafka.exactly-once | Enables Kafka read-process-write exactly-once mode. On the source endpoint, also configure allowManualCommit=true, autoCommitEnable=false, breakOnFirstError=true and an explicit, non-blank groupId. On the destination endpoint, configure an explicit transactionalId base that is unique to this Camel runtime instance and stable across restarts. Camel appends the owning route id so producers in different routes do not share a Kafka transactional id. transacted=true without an explicit transactional id is not sufficient for exactly-once mode. | false | Boolean |
camel.component.kafka.fetch-max-bytes | 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. | 52428800 | Integer |
camel.component.kafka.fetch-min-bytes | 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. | 1 | Integer |
camel.component.kafka.fetch-wait-max-ms | The maximum time, in milliseconds, that the server blocks before answering a fetch request when there isn’t enough data to immediately satisfy fetchMinBytes. | 500 | Integer |
camel.component.kafka.group-id | A string that uniquely identifies the group of consumer processes to which this consumer belongs. By setting the same group id, multiple processes can indicate that they are all part of the same consumer group. It takes precedence over a group.id set in additionalProperties. If neither is set, the consumer uses a generated group id, a new one at each start, and logs a WARN: it does not resume from the offsets committed before a restart, and each instance of the application receives every record. Set it on a consumer that must resume after a restart or share the records with other instances. | String | |
camel.component.kafka.group-instance-id | A unique identifier of the consumer instance provided by the end user. Only non-empty strings are permitted. If set, the consumer is treated as a static member, which means that only one instance with this ID is allowed in the consumer group at any time. This can be used in combination with a larger session timeout to avoid group rebalances caused by transient unavailability (e.g., process restarts). If not set, the consumer will join the group as a dynamic member, which is the traditional behavior. When consumersCount is greater than 1, each consumer is a static member of its own, with this ID followed by a dash and the index of the consumer (myId-0, myId-1, …). | String | |
camel.component.kafka.group-protocol | The consumer group protocol to use. The classic protocol uses the traditional partition assignment and rebalancing mechanism. The consumer protocol enables the new KIP-848 consumer rebalance protocol which provides faster and more efficient rebalancing. When set to consumer, classic-only properties (heartbeatIntervalMs, sessionTimeoutMs, partitionAssignor) are automatically excluded from the consumer configuration. | classic | String |
camel.component.kafka.group-remote-assignor | The name of the server-side assignor to use when groupProtocol is set to consumer. If not specified, the group coordinator uses the default assignor configured on the broker (group.consumer.assignors). | String | |
camel.component.kafka.header-deserializer | To use a custom KafkaHeaderDeserializer to deserialize kafka headers values. The option is a org.apache.camel.component.kafka.serde.KafkaHeaderDeserializer type. | KafkaHeaderDeserializer | |
camel.component.kafka.header-filter-strategy | To use a custom HeaderFilterStrategy to filter header to and from Camel message. The option is a org.apache.camel.spi.HeaderFilterStrategy type. | HeaderFilterStrategy | |
camel.component.kafka.header-serializer | The KafkaHeaderSerializer that converts the values of the Camel headers that the headerFilterStrategy lets through into the values of the Kafka record headers. The default DefaultKafkaHeaderSerializer writes a String or a Boolean as text, a Long, Integer or Double as its bytes, keeps a byte[], converts other values to byte[] with the Camel type converter, and leaves out a header that it cannot convert. The option is a org.apache.camel.component.kafka.serde.KafkaHeaderSerializer type. | KafkaHeaderSerializer | |
camel.component.kafka.health-check-consumer-enabled | Used for enabling or disabling all consumer based health checks from this component | true | Boolean |
camel.component.kafka.health-check-producer-enabled | Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true. | true | Boolean |
camel.component.kafka.heartbeat-interval-ms | 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. This option is only used when groupProtocol is set to classic. In that case, the value must be set lower than sessionTimeoutMs, 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. When groupProtocol is set to consumer, the heartbeat interval is controlled by the broker with group.consumer.heartbeat.interval.ms, and this option is left out of the consumer configuration. | 3000 | Integer |
camel.component.kafka.interceptor-classes | Comma-separated class names of Kafka interceptors (interceptor.classes), set on both the Kafka producer and the Kafka consumer of the endpoint. A producer interceptor implements org.apache.kafka.clients.producer.ProducerInterceptor, a consumer interceptor org.apache.kafka.clients.consumer.ConsumerInterceptor. A Kafka client fails to start (KafkaException) when the list has an interceptor of the other kind, so use it on an endpoint that only produces or only consumes. | String | |
camel.component.kafka.isolation-level | Controls how to read messages written transactionally. If set to read_committed, consumer.poll() will only return transactional messages which have been committed. If set to read_uncommitted (the default), consumer.poll() will return all messages, even transactional messages which have been aborted. Non-transactional messages will be returned unconditionally in either mode. Messages will always be returned in offset order. Hence, in read_committed mode, consumer.poll() will only return messages up to the last stable offset (LSO), which is the one less than the offset of the first open transaction. In particular, any messages appearing after messages belonging to ongoing transactions will be withheld until the relevant transaction has been completed. As a result, read_committed consumers will not be able to read up to the high watermark when there are in flight transactions. Further, when in read_committed the seekToEnd method will return the LSO | read_uncommitted | String |
camel.component.kafka.kafka-client-factory | The factory that creates the Kafka clients (org.apache.kafka.clients.consumer.KafkaConsumer and org.apache.kafka.clients.producer.KafkaProducer) from the properties of the endpoint, and gives their bootstrap servers, for example to create clients that extend the Kafka clients. The default DefaultKafkaClientFactory creates the Kafka clients and uses the brokers option. The option is a org.apache.camel.component.kafka.KafkaClientFactory type. | KafkaClientFactory | |
camel.component.kafka.kafka-manual-commit-factory | The factory that creates the KafkaManualCommit of each exchange when allowManualCommit is enabled, which also selects how the offsets are committed. With DefaultKafkaManualCommitFactory, commit() commits synchronously (commitSync). With DefaultKafkaManualAsyncCommitFactory, commit() records the offset and the consumer thread commits it asynchronously (commitAsync) before its next poll, so commit() can be called from another thread. With these two, breakOnFirstError also commits the records before the failed record (not in batching mode). When not set, commit() commits synchronously. When not set, or with a custom factory (which creates custom KafkaManualCommit instances), Camel commits no offsets of its own, also not for breakOnFirstError. The option is a org.apache.camel.component.kafka.consumer.KafkaManualCommitFactory type. | KafkaManualCommitFactory | |
camel.component.kafka.kerberos-before-relogin-min-time | Login thread sleep time between refresh attempts. | 60000 | Integer |
camel.component.kafka.kerberos-config-location | Location of the kerberos config file. | String | |
camel.component.kafka.kerberos-init-cmd | Kerberos kinit command path. Default is /usr/bin/kinit | /usr/bin/kinit | String |
camel.component.kafka.kerberos-principal-to-local-rules | 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 made of a username, a hostname and a Kerberos realm are mapped to the username. For more details on the format, please see the Security Authorization and ACLs documentation (at the Apache Kafka project website). Multiple values can be separated by comma | DEFAULT | String |
camel.component.kafka.kerberos-renew-jitter | Percentage of random jitter added to the renewal time. | Double | |
camel.component.kafka.kerberos-renew-window-factor | 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. | Double | |
camel.component.kafka.key | The key of the records, converted for the keySerializer. It takes precedence over the CamelKafkaKey header, except for an element of an Iterable body (see useIterator) that is an Exchange or a Message with that header. | String | |
camel.component.kafka.key-deserializer | Deserializer class for the key that implements the Deserializer interface. | org.apache.kafka.common.serialization.StringDeserializer | String |
camel.component.kafka.key-serializer | The serializer class for keys. It must implement the org.apache.kafka.common.serialization.Serializer interface. | org.apache.kafka.common.serialization.StringSerializer | String |
camel.component.kafka.lazy-start-producer | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | Boolean |
camel.component.kafka.linger-ms | 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 a moderate load. This setting achieves 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 they 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 producerBatchSize 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 5 (i.e., 5ms delay). Increasing it to 50, for example, would have the effect of reducing the number of requests sent but would add up to 50ms of latency to records sent in the absence of load. The default changed from 0 to 5 in Apache Kafka 4.0 as the efficiency gains from larger batches typically result in similar or lower producer latency despite the increased linger. | 5 | Integer |
camel.component.kafka.max-block-ms | The configuration controls how long the KafkaProducer’s send(), partitionsFor(), initTransactions(), sendOffsetsToTransaction(), commitTransaction() and abortTransaction() methods will block. For send() this timeout bounds the total time waiting for both metadata fetch and buffer allocation (blocking in the user-supplied serializers or partitioner is not counted against this timeout). For partitionsFor() this time out bounds the time spent waiting for metadata if it is unavailable. The transaction-related methods always block, but may time out if the transaction coordinator could not be discovered or did not respond within the timeout. | 60000 | Integer |
camel.component.kafka.max-in-flight-request | 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 enableIdempotence is set to false, there is a risk of message reordering after a failed send due to retries (i.e., if retries are enabled); if retries are disabled or if enableIdempotence is set to true, ordering will be preserved. Additionally, enabling idempotence requires the value of this setting to be less than or equal to 5, because the broker only retains at most 5 batches for each producer. If the value is more than 5, previous batches may be removed on the broker side. | 5 | Integer |
camel.component.kafka.max-partition-fetch-bytes | The maximum amount of data per-partition the server will return. This is not an absolute maximum, if the first record batch in the first non-empty partition of the fetch is larger than this value, the batch will still be returned to ensure that the consumer can make progress. The maximum record batch size accepted by the broker is defined via message.max.bytes (broker config) or max.message.bytes (topic config). See fetchMaxBytes for limiting the consumer request size. | 1048576 | Integer |
camel.component.kafka.max-poll-interval-ms | 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 re-balance to reassign the partitions to another member. The option is a java.lang.Integer type. | 300000 | Integer |
camel.component.kafka.max-poll-records | The maximum number of records returned in a single call to poll(). It does not change how much data the consumer fetches from the brokers. In batching mode, it is also the maximum number of records in a batch. | 500 | Integer |
camel.component.kafka.max-request-size | The maximum size of a request in bytes. This setting will limit the number of record batches the producer will send in a single request to avoid sending huge requests. This is also effectively a cap on the maximum uncompressed record batch size. Note that the server has its own cap on the record batch size (after compression if compression is enabled) which may be different from this. | 1048576 | Integer |
camel.component.kafka.metadata-max-age-ms | 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. | 300000 | Integer |
camel.component.kafka.metric-reporters | A list of classes to use as metrics reporters. Implementing the org.apache.kafka.common.metrics.MetricsReporter interface allows plugging in classes that will be notified of new metric creation. When custom reporters are set and org.apache.kafka.common.metrics.JmxReporter is needed, it has to be explicitly added to the list. | String | |
camel.component.kafka.metrics-sample-window-ms | The window of time a metrics sample is computed over. | 30000 | Integer |
camel.component.kafka.no-of-metrics-sample | The number of samples maintained to compute metrics. | 2 | Integer |
camel.component.kafka.oauth-client-id | OAuth client ID. Used when saslAuthType is set to OAUTH. | String | |
camel.component.kafka.oauth-client-secret | OAuth client secret. Used when saslAuthType is set to OAUTH. | String | |
camel.component.kafka.oauth-scope | OAuth scope. Used when saslAuthType is set to OAUTH. | String | |
camel.component.kafka.oauth-token-endpoint-uri | OAuth token endpoint URI. Used when saslAuthType is set to OAUTH. | String | |
camel.component.kafka.offset-repository | The repository (a StateRepository) in which the consumer stores the offset of each partition, under the key topic/partition, after it has processed the records of the partition. When a partition is assigned, the consumer seeks to the stored offset, so it resumes after the last stored record. Setting it turns off the Kafka auto commit, and without allowManualCommit the offsets are not committed to Kafka. seekTo is not used when it is set. The option is a org.apache.camel.spi.StateRepository<java.lang.String, java.lang.String> type. | String> | |
camel.component.kafka.partition-assignor | The class names of the partition assignment strategies, ordered by preference, that the client will use to distribute partition ownership amongst consumer instances when group management is used. Multiple class names can be separated by comma. If not set, the Kafka default is used: org.apache.kafka.clients.consumer.RangeAssignor and org.apache.kafka.clients.consumer.CooperativeStickyAssignor. This uses the RangeAssignor, but allows upgrading to the CooperativeStickyAssignor with a single rolling restart that removes the RangeAssignor from the list. This option is only used when groupProtocol is set to classic. | String | |
camel.component.kafka.partition-key | The partition to send the records to. It takes precedence over the CamelKafkaPartitionKey header. If neither is set, the partitioner chooses the partition. | Integer | |
camel.component.kafka.partitioner | The partitioner class that determines which partition to send a record to. If not set, the default partitioning logic is used: a record with a key goes to a partition chosen by a hash of the key, and a record without a key goes to a sticky partition that changes when at least producerBatchSize bytes have been produced to it. A custom partitioner implements the org.apache.kafka.clients.producer.Partitioner interface. | String | |
camel.component.kafka.partitioner-ignore-keys | Whether the default partitioning logic ignores the record keys (partitioner.ignore.keys): if true, a record with a key goes to a partition as a record without a key does, instead of to the partition of the hash of its key. No effect when partitioner is set. | false | Boolean |
camel.component.kafka.poll-exception-strategy | A custom PollExceptionStrategy that decides how the consumer handles an exception thrown while polling records, instead of pollOnError. One instance is shared by all consumer threads; pollExceptionStrategyFactory takes precedence. Only used by the kafka component. The option is a org.apache.camel.component.kafka.PollExceptionStrategy type. | PollExceptionStrategy | |
camel.component.kafka.poll-exception-strategy-factory | Factory to create a PollExceptionStrategy per Kafka consumer fetch thread. Unlike the pollExceptionStrategy option, which shares a single strategy across all consumer threads, the factory is invoked each time a fetch thread creates its Kafka consumer (on start and on every reconnect), so each thread gets its own strategy bound to its current consumer. This is required by strategies that drive the consumer (such as the built-in reconnect, stop, and bridge strategies), and it also works correctly when an endpoint uses multiple consumer threads. The factory may be called concurrently and must be thread-safe. The option is a org.apache.camel.component.kafka.PollExceptionStrategyFactory type. | PollExceptionStrategyFactory | |
camel.component.kafka.poll-on-error | What to do when the Kafka consumer throws an exception while polling, for example for a record that cannot be deserialized. DISCARD logs it and polls again. ERROR_HANDLER routes the exception to the Camel error handler of the route and polls again, but stops the consumer on an authentication or authorization error. RECONNECT closes the Kafka consumer and creates a new one, which polls again from the committed offset, but stops the consumer on an authentication error. RETRY polls again with the same Kafka consumer. STOP stops the consumer: restart the route to consume again. DISCARD and ERROR_HANDLER skip a record that cannot be deserialized (the consumer seeks to the next offset); the other exceptions do not move the offsets. Not used when the component has a pollExceptionStrategy or a pollExceptionStrategyFactory. | error-handler | PollOnError |
camel.component.kafka.poll-timeout-ms | The maximum time, in milliseconds, that each poll() of the Kafka consumer waits for records when none are available. In batching mode, an incomplete batch is also processed when a poll returns no records and this time has passed since the batch was started. The option is a java.lang.Long type. | 5000 | Long |
camel.component.kafka.pre-validate-host-and-port | Whether to eager validate that broker host:port is valid and can be DNS resolved to known host during starting this consumer. If the validation fails, then an exception is thrown, which makes Camel fail fast. Disabling this will postpone the validation after the consumer is started, and Camel will keep re-connecting in case of validation or DNS resolution error. | true | Boolean |
camel.component.kafka.producer-batch-size | 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. | 16384 | Integer |
camel.component.kafka.receive-buffer-bytes | The size of the TCP receive buffer (SO_RCVBUF) to use when reading data. If the value is -1, the OS default will be used. | 65536 | Integer |
camel.component.kafka.reconnect-backoff-max-ms | 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. | 1000 | Integer |
camel.component.kafka.reconnect-backoff-ms | The base 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 connection attempts by the client to a broker. This value is the initial backoff value and will increase exponentially for each consecutive connection failure, up to the reconnectBackoffMaxMs value. | 50 | Integer |
camel.component.kafka.record-metadata | Whether the producer stores the RecordMetadata (topic, partition, offset and timestamp) that Kafka returns for the records it sent, as a List of RecordMetadata in the CamelKafkaRecordMeta header. With an Iterable body (see useIterator), the list has the metadata of every record, and each element that is an Exchange or a Message gets the metadata of its own record in the same header. | false | Boolean |
camel.component.kafka.request-required-acks | 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 allowed: 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 retry 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 acknowledgment 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. This is equivalent to the acks=-1 setting. Note that enabling idempotence requires this config value to be 'all'. If conflicting configurations are set and idempotence is not explicitly enabled, idempotence is disabled. | all | String |
camel.component.kafka.request-timeout-ms | 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. This should be larger than replica.lag.time.max.ms (a broker configuration) to reduce the possibility of message duplication due to unnecessary producer retries. | 30000 | Integer |
camel.component.kafka.retries | Number of times to retry a request that fails with a transient error. Setting a value greater than zero will cause the client to resend any record whose send fails with a potentially transient error. Requests will be retried this many times until they succeed, fail with a non-transient error, or the deliveryTimeoutMs expires. Note that this automatic retry will simply resend the same record upon receiving the error. Setting a value of zero will disable this automatic retry behaviour, so that the transient errors will be propagated to the application to be handled. Users should generally prefer to leave this config unset and instead use deliveryTimeoutMs to control retry behavior. Enabling idempotence requires this config value to be greater than 0. If conflicting configurations are set and idempotence is not explicitly enabled, idempotence is disabled. Allowing retries while setting enable.idempotence to false and max.in.flight.requests.per.connection to greater than 1 will potentially change the ordering of records, because if two batches are sent to a single partition, and the first fails and is retried but the second succeeds; then the records in the second batch may appear first. | Integer | |
camel.component.kafka.retry-backoff-max-ms | The maximum amount of time in milliseconds to wait when retrying a request to the broker that has repeatedly failed. If provided, the backoff per client will increase exponentially for each failed request, up to this maximum. To prevent all clients from being synchronized upon retry, a randomized jitter with a factor of 0.2 will be applied to the backoff, resulting in the backoff falling within a range between 20% below and 20% above the computed value. If retry.backoff.ms is set to be higher than retry.backoff.max.ms, then retry.backoff.max.ms will be used as a constant backoff from the beginning without any exponential increase | 1000 | Integer |
camel.component.kafka.retry-backoff-ms | The amount of time to wait before attempting to retry a failed request to a given topic partition. This avoids repeatedly sending requests in a tight loop under some failure scenarios. This value is the initial backoff value and will increase exponentially for each failed request, up to the retry.backoff.max.ms value. | 100 | Integer |
camel.component.kafka.sasl-auth-type | Simplified authentication type to use. This provides an easier way to configure Kafka authentication without manually setting securityProtocol, saslMechanism, and saslJaasConfig. When set, the appropriate security settings are automatically derived. Note: This is optional. You can still use the traditional approach with explicit securityProtocol, saslMechanism, and saslJaasConfig properties. | KafkaAuthType | |
camel.component.kafka.sasl-jaas-config | Expose the kafka sasl.jaas.config parameter Example: org.apache.kafka.common.security.plain.PlainLoginModule required username=USERNAME password=PASSWORD; | String | |
camel.component.kafka.sasl-kerberos-service-name | The Kerberos principal name that Kafka runs as. This can be defined either in Kafka’s JAAS config or in Kafka’s config. | String | |
camel.component.kafka.sasl-mechanism | The Simple Authentication and Security Layer (SASL) Mechanism used. For the valid values see http://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml | GSSAPI | String |
camel.component.kafka.sasl-password | Password for SASL authentication. Used when saslAuthType is set to PLAIN, SCRAM_SHA_256, or SCRAM_SHA_512. | String | |
camel.component.kafka.sasl-username | Username for SASL authentication. Used when saslAuthType is set to PLAIN, SCRAM_SHA_256, or SCRAM_SHA_512. | String | |
camel.component.kafka.schema-format | The format of the record values in the schema registry, which selects the serializer and deserializer of the schemaRegistryVendor. Not every vendor supports every format: azure supports only avro. Only used when schemaRegistryVendor is set. | avro | String |
camel.component.kafka.schema-registry-oauth-client-id | The OAuth2 client id to log in to the schema registry with client credentials. Used with schemaRegistryVendor confluent and apicurio. | String | |
camel.component.kafka.schema-registry-oauth-client-secret | The OAuth2 client secret to log in to the schema registry with client credentials. | String | |
camel.component.kafka.schema-registry-oauth-scope | The OAuth2 scope to ask for when logging in to the schema registry with client credentials (optional). | String | |
camel.component.kafka.schema-registry-oauth-token-endpoint | The token endpoint of the OAuth2 server to log in to the schema registry with client credentials, with schemaRegistryOauthClientId and schemaRegistryOauthClientSecret. Used with schemaRegistryVendor confluent (bearer.auth.issuer.endpoint.url) and apicurio (apicurio.registry.auth.service.token.endpoint, such as the token endpoint of a Keycloak realm). | String | |
camel.component.kafka.schema-registry-password | The password to log in to the schema registry with basic auth, with schemaRegistryUsername. For Confluent Cloud, the API secret. | String | |
camel.component.kafka.schema-registry-u-r-l | URL of the schema registry servers to use. The format is host1:port1,host2:port2. This is known as schema.registry.url in multiple Schema registries documentation. This option is only available externally (not standard Apache Kafka). When schemaRegistryVendor is set, the URL is set under the property of the vendor: schema.registry.url for confluent, apicurio.registry.url for apicurio (the URL of the registry API, such as http://localhost:8080/apis/registry/v3), schema.registry.url for azure (the fully qualified namespace, such as my-namespace.servicebus.windows.net), and endpoint for aws-glue (optional, as Glue is addressed by the AWS region). | String | |
camel.component.kafka.schema-registry-username | The username to log in to the schema registry with basic auth, with schemaRegistryPassword. Used with schemaRegistryVendor confluent (basic.auth.user.info, which is the API key for Confluent Cloud) and apicurio (apicurio.registry.auth.username). The azure and aws-glue vendors log in with the credentials of the environment instead. | String | |
camel.component.kafka.schema-registry-vendor | The schema registry vendor, which sets up the value serializer (producer), the value deserializer (consumer) and the registry properties of the vendor for the schemaFormat, so that you do not need to know the class names or the property names of the vendor. The schemaRegistryURL is set as the registry URL of the vendor. A valueSerializer or valueDeserializer other than the default, and additionalProperties, take precedence. The serde jars of the vendor must be on the classpath, as Camel does not include them. Leave it unset to configure the serializer, deserializer and registry properties yourself. | String | |
camel.component.kafka.security-protocol | Protocol used to communicate with brokers. SASL_PLAINTEXT, PLAINTEXT, SASL_SSL and SSL are supported | PLAINTEXT | String |
camel.component.kafka.seek-to | Seeks the consumer to the beginning (BEGINNING) or to the end (END) of each partition that is assigned to it, regardless of the committed offset: BEGINNING reads all the records of the partition again, END skips the records that are already there. The seek is done on every partition assignment: when the consumer starts, after a rebalance, and when the consumer reconnects (for example after breakOnFirstError or with pollOnError RECONNECT). Not used when offsetRepository is set. | SeekPolicy | |
camel.component.kafka.send-buffer-bytes | The size of the TCP send buffer (SO_SNDBUF) to use when sending data. If the value is -1, the OS default will be used. | 131072 | Integer |
camel.component.kafka.session-timeout-ms | The timeout used to detect client failures when using Kafka’s group management facility. The client sends periodic heartbeats to indicate its liveness to the broker. If no heartbeats are received by the broker before the expiration of this session timeout, then the broker will remove this client from the group and initiate a rebalance. Note that the value must be in the allowable range as configured in the broker configuration by group.min.session.timeout.ms and group.max.session.timeout.ms. This option is only used when groupProtocol is set to classic. When groupProtocol is set to consumer, the session timeout is controlled by the broker with group.consumer.session.timeout.ms, and this option is left out of the consumer configuration. | 45000 | Integer |
camel.component.kafka.shutdown-timeout | Timeout in milliseconds to wait gracefully for the consumer or producer to shut down and terminate its worker threads. | 30000 | Integer |
camel.component.kafka.specific-avro-reader | This enables the use of a specific Avro reader for use with the in multiple Schema registries documentation with Avro Deserializers implementation. This option is only available externally (not standard Apache Kafka). When schemaRegistryVendor is set, it is set under the property of the vendor (for apicurio apicurio.registry.use-specific-avro-reader, for aws-glue avroRecordType=SPECIFIC_RECORD). | false | Boolean |
camel.component.kafka.ssl-cipher-suites | 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. | String | |
camel.component.kafka.ssl-context-parameters | SSL configuration using a Camel SSLContextParameters object. When configured, Camel creates Kafka TLS engines with its own SslEngineFactory and this SSL context. It takes precedence over the other SSL endpoint options and additionalProperties entries whose names start with ssl.; only sslEndpointAlgorithm remains applicable for broker hostname verification. The option is a org.apache.camel.support.jsse.SSLContextParameters type. | SSLContextParameters | |
camel.component.kafka.ssl-enabled-protocols | The list of protocols enabled for SSL connections. The default is TLSv1.2,TLSv1.3. This means that clients and servers will prefer TLSv1.3 if both support it and fallback to TLSv1.2 otherwise (assuming both support at least TLSv1.2). This default should be fine for most use cases. Also see the documentation of sslProtocol to understand how it can impact the TLS version negotiation behavior. | TLSv1.2,TLSv1.3 | String |
camel.component.kafka.ssl-endpoint-algorithm | The endpoint identification algorithm to validate server hostname using server certificate. Use none or false to disable server hostname verification. | https | String |
camel.component.kafka.ssl-key-password | The password of the private key in the key store file or the PEM key specified in sslKeystoreKey. This is required for clients only if two-way authentication is configured. | String | |
camel.component.kafka.ssl-keymanager-algorithm | The algorithm used by key manager factory for SSL connections. Default value is the key manager factory algorithm configured for the Java Virtual Machine. | SunX509 | String |
camel.component.kafka.ssl-keystore-location | The location of the key store file. This is optional for the client and can be used for two-way authentication for the client. | String | |
camel.component.kafka.ssl-keystore-password | The store password for the key store file. This is optional for the client and only needed if sslKeystoreLocation is configured. Key store password is not supported for PEM format. | String | |
camel.component.kafka.ssl-keystore-type | The file format of the key store file. This is optional for the client. The supported values are JKS, PKCS12 and PEM. | JKS | String |
camel.component.kafka.ssl-protocol | The SSL protocol used to generate the SSLContext. The default is TLSv1.3, which should be fine for most use cases. A typical alternative to the default is TLSv1.2. Allowed values for this config are dependent on the JVM. Clients using the defaults for this config and sslEnabledProtocols will downgrade to TLSv1.2 if the server does not support TLSv1.3. If this config is set to TLSv1.2, however, clients will not use TLSv1.3 even if it is one of the values in sslEnabledProtocols and the server only supports TLSv1.3. | TLSv1.3 | String |
camel.component.kafka.ssl-provider | The name of the security provider used for SSL connections. Default value is the default security provider of the JVM. | String | |
camel.component.kafka.ssl-trustmanager-algorithm | The algorithm used by trust manager factory for SSL connections. Default value is the trust manager factory algorithm configured for the Java Virtual Machine. | PKIX | String |
camel.component.kafka.ssl-truststore-location | The location of the trust store file. | String | |
camel.component.kafka.ssl-truststore-password | The password for the trust store file. If a password is not set, trust store file configured will still be used, but integrity checking is disabled. Trust store password is not supported for PEM format. | String | |
camel.component.kafka.ssl-truststore-type | The file format of the trust store file. The supported values are JKS, PKCS12 and PEM. | JKS | String |
camel.component.kafka.subscribe-consumer-topic-must-exists | Whether the consumer checks, after it has subscribed, that the topic exists on the brokers (with topicIsPattern, that a topic matches the pattern), and fails if it does not. The failure is retried as set by createConsumerBackoffMaxAttempts and createConsumerBackoffInterval. If false, the consumer also subscribes to a topic that does not exist, and receives its records once it is created. | false | Boolean |
camel.component.kafka.synchronous | Whether the producer sends synchronously: the routing thread sends the records and waits until Kafka has acknowledged them, and no worker pool is used. If false, the producer is asynchronous: the routing of the exchange continues on the worker pool when Kafka has acknowledged the records. | false | Boolean |
camel.component.kafka.topic-is-pattern | Whether the topic is a regular expression (java.util.regex.Pattern): the consumer subscribes to every topic whose name matches it, also to the topics created later, which the Kafka consumer finds when it refreshes its metadata (see metadataMaxAgeMs). | false | Boolean |
camel.component.kafka.transacted | Whether the producer is transactional, with a transactional.id that Camel makes from the id of the endpoint (endpoint followed by a number, in the order in which Camel creates the endpoints) and the route id. Each exchange sends its records in a Kafka transaction that is committed when the exchange completes, or aborted when it fails. Set transactionalId for an id that stays the same across restarts. Not used when transactionalId or the transactional.id additional property is set. | false | Boolean |
camel.component.kafka.transactional-id | The transactional.id of the producer, which makes it a transactional producer: each exchange sends its records in a Kafka transaction that is committed when the exchange completes, or aborted when it fails. Use an id that is unique to the producer and stays the same across restarts. When it is set, transacted is not used. With exactlyOnce, Camel appends the route id. | String | |
camel.component.kafka.use-global-ssl-context-parameters | Whether to use the global SSL context parameters of the CamelContext when the endpoint has no sslContextParameters. | false | Boolean |
camel.component.kafka.use-iterator | Sets whether sending to kafka should send the message body as a single record, or use a java.util.Iterator to send multiple records to kafka (if the message body can be iterated). A Jackson JSON array node is sent as one record per element, and any other JSON node (such as an object) as one record. | true | Boolean |
camel.component.kafka.value-deserializer | Deserializer class for value that implements the Deserializer interface. | org.apache.kafka.common.serialization.StringDeserializer | String |
camel.component.kafka.value-serializer | The serializer class for values (the message body). It must implement the org.apache.kafka.common.serialization.Serializer interface. | org.apache.kafka.common.serialization.StringSerializer | String |
camel.component.kafka.worker-pool | The thread pool on which the producer continues routing the exchange after Kafka has acknowledged the records (the send callback runs on the I/O thread of the Kafka producer, which must not route). Only used when synchronous is disabled. Camel does not shut down a pool set here: you manage its lifecycle. If not set, the producer creates a pool with workerPoolCoreSize and workerPoolMaxSize threads. The option is a java.util.concurrent.ExecutorService type. | ExecutorService | |
camel.component.kafka.worker-pool-core-size | The number of core threads of the worker pool that the producer creates when workerPool is not set, on which it continues routing the exchange after Kafka has acknowledged the records. | 10 | Integer |
camel.component.kafka.worker-pool-max-size | The maximum number of threads of the worker pool that the producer creates when workerPool is not set, on which it continues routing the exchange after Kafka has acknowledged the records. | 20 | Integer |
camel.component.kafka.queue-buffering-max-messages | Deprecated: this option has no effect. Use bufferMemorySize or maxBlockMs instead. | 10000 | Integer |
camel.component.kafka.subscribe-consumer-backoff-interval | Deprecated: this option has no effect. Use createConsumerBackoffInterval instead. | 5000 | Long |
camel.component.kafka.subscribe-consumer-backoff-max-attempts | Deprecated: this option has no effect. Use createConsumerBackoffMaxAttempts instead. | Integer |