//tag::ref-doc[]
= Apache Kafka Sink

This module publishes messages to Apache Kafka.

== Options

The **$$kafka$$** $$sink$$ has the following options:

(See the Spring Boot documentation for Spring for Apache Kafka configuration properties)

//tag::configuration-properties[]
Properties grouped by prefix:


=== kafka.publisher

$$key$$:: $$Kafka record key - overridden by keyExpression, if supplied.$$ *($$String$$, default: `$$<none>$$`)*
$$key-expression$$:: $$A SpEL expression that evaluates to a Kafka record key.$$ *($$Expression$$, default: `$$<none>$$`)*
$$mapped-headers$$:: $$Headers that will be mapped.$$ *($$String[]$$, default: `$$[*]$$`)*
$$partition$$:: $$Kafka topic partition - overridden by partitionExpression, if supplied.$$ *($$Integer$$, default: `$$<none>$$`)*
$$partition-expression$$:: $$A SpEL expression that evaluates to a Kafka topic partition.$$ *($$Expression$$, default: `$$<none>$$`)*
$$send-timeout$$:: $$How long Kafka producer handler should wait for send operation results. Defaults to 10 seconds.$$ *($$Duration$$, default: `$$10s$$`)*
$$sync$$:: $$True if Kafka producer handler should operation in a sync mode.$$ *($$Boolean$$, default: `$$false$$`)*
$$timestamp$$:: $$Kafka record timestamp - overridden by timestampExpression, if supplied.$$ *($$Long$$, default: `$$<none>$$`)*
$$timestamp-expression$$:: $$A SpEL expression that evaluates to a Kafka record timestamp.$$ *($$Expression$$, default: `$$<none>$$`)*
$$topic$$:: $$Kafka topic - overridden by topicExpression, if supplied. Defaults to KafkaTemplate.getDefaultTopic()$$ *($$String$$, default: `$$<none>$$`)*
$$topic-expression$$:: $$A SpEL expression that evaluates to a Kafka topic.$$ *($$Expression$$, default: `$$<none>$$`)*
$$use-template-converter$$:: $$Whether to use the template's message converter to create a Kafka record.$$ *($$Boolean$$, default: `$$false$$`)*

=== spring.kafka

$$bootstrap-servers$$:: $$Comma-delimited list of host:port pairs to use for establishing the initial connections to the Kafka cluster. Applies to all components unless overridden.$$ *($$List<String>$$, default: `$$<none>$$`)*
$$client-id$$:: $$ID to pass to the server when making requests. Used for server-side logging.$$ *($$String$$, default: `$$<none>$$`)*
$$properties$$:: $$Additional properties, common to producers and consumers, used to configure the client.$$ *($$Map<String, String>$$, default: `$$<none>$$`)*

=== spring.kafka.producer

$$acks$$:: $$Number of acknowledgments the producer requires the leader to have received before considering a request complete.$$ *($$String$$, default: `$$<none>$$`)*
$$batch-size$$:: $$Default batch size. A small batch size will make batching less common and may reduce throughput (a batch size of zero disables batching entirely).$$ *($$DataSize$$, default: `$$<none>$$`)*
$$bootstrap-servers$$:: $$Comma-delimited list of host:port pairs to use for establishing the initial connections to the Kafka cluster. Overrides the global property, for producers.$$ *($$List<String>$$, default: `$$<none>$$`)*
$$buffer-memory$$:: $$Total memory size the producer can use to buffer records waiting to be sent to the server.$$ *($$DataSize$$, default: `$$<none>$$`)*
$$client-id$$:: $$ID to pass to the server when making requests. Used for server-side logging.$$ *($$String$$, default: `$$<none>$$`)*
$$compression-type$$:: $$Compression type for all data generated by the producer.$$ *($$String$$, default: `$$<none>$$`)*
$$key-serializer$$:: $$Serializer class for keys.$$ *($$Class<?>$$, default: `$$<none>$$`)*
$$properties$$:: $$Additional producer-specific properties used to configure the client.$$ *($$Map<String, String>$$, default: `$$<none>$$`)*
$$retries$$:: $$When greater than zero, enables retrying of failed sends.$$ *($$Integer$$, default: `$$<none>$$`)*
$$transaction-id-prefix$$:: $$When non empty, enables transaction support for producer.$$ *($$String$$, default: `$$<none>$$`)*
$$value-serializer$$:: $$Serializer class for values.$$ *($$Class<?>$$, default: `$$<none>$$`)*

=== spring.kafka.template

$$default-topic$$:: $$Default topic to which messages are sent.$$ *($$String$$, default: `$$<none>$$`)*
$$transaction-id-prefix$$:: $$Transaction id prefix, override the transaction id prefix in the producer factory.$$ *($$String$$, default: `$$<none>$$`)*
//end::configuration-properties[]

//end::ref-doc[]
