Polish "Add KafkaAdmin Auto Configuration"
Closes gh-10309
This commit is contained in:
@@ -939,9 +939,8 @@ content into your application; rather pick only the properties that you need.
|
||||
spring.jms.template.time-to-live= # Time-to-live of a message when sending in milliseconds. Enable QoS when set.
|
||||
|
||||
# APACHE KAFKA ({sc-spring-boot-autoconfigure}/kafka/KafkaProperties.{sc-ext}[KafkaProperties])
|
||||
spring.kafka.admin.bootstrap-servers= # Comma-delimited list of host:port pairs to use for establishing the initial connection to the Kafka cluster.
|
||||
spring.kafka.admin.client-id= # Id to pass to the server when making requests; used for server-side logging.
|
||||
spring.kafka.admin.fail-if-no-brokers=false # When true, the application context will not load if the broker connection fails when attempting to provision topics.
|
||||
spring.kafka.admin.fail-fast=false # Fail fast if the broker is not available on startup.
|
||||
spring.kafka.admin.properties.*= # Additional admin-specific properties used to configure the client.
|
||||
spring.kafka.admin.ssl.key-password= # Password of the private key in the key store file.
|
||||
spring.kafka.admin.ssl.keystore-location= # Location of the key store file.
|
||||
|
||||
@@ -4816,20 +4816,14 @@ Kafka configuration is controlled by external configuration properties in
|
||||
spring.kafka.consumer.group-id=myGroup
|
||||
----
|
||||
|
||||
TIP: To create a topic on startup, simply add a bean of type `NewTopic`. If the topic
|
||||
already exists, the related bean is ignored.
|
||||
|
||||
See {sc-spring-boot-autoconfigure}/kafka/KafkaProperties.{sc-ext}[`KafkaProperties`]
|
||||
for more of the supported options.
|
||||
|
||||
|
||||
|
||||
[[boot-features-kafka-topics]]
|
||||
==== Creating Topics
|
||||
|
||||
Spring Boot auto configuration will add a `KafkaAdmin` bean to the application context.
|
||||
This bean will automatically create a topic for each `NewTopic` bean in the application context.
|
||||
Topics can only be added with this technique, not modified; if a topic already exists, the `NewTopic` bean is ignored.
|
||||
|
||||
|
||||
|
||||
[[boot-features-kafka-sending-a-message]]
|
||||
==== Sending a Message
|
||||
Spring's `KafkaTemplate` is auto-configured and you can autowire them directly in your own
|
||||
|
||||
Reference in New Issue
Block a user