Class KafkaProperties

java.lang.Object
org.springframework.boot.kafka.autoconfigure.KafkaProperties

@ConfigurationProperties("spring.kafka") public class KafkaProperties extends Object
Configuration properties for Spring for Apache Kafka.

Users should refer to Kafka documentation for complete descriptions of these properties.

Since:
4.0.0
Author:
Gary Russell, Stephane Nicoll, Artem Bilan, Nakul Mishra, Tomaz Fernandes, Andy Wilkinson, Scott Frederick, Yanming Zhou, Nikita Kibitkin
  • Constructor Details

    • KafkaProperties

      public KafkaProperties()
  • Method Details

    • getBootstrapServers

      public List<String> getBootstrapServers()
    • setBootstrapServers

      public void setBootstrapServers(List<String> bootstrapServers)
    • getClientId

      public @Nullable String getClientId()
    • setClientId

      public void setClientId(@Nullable String clientId)
    • getProperties

      public Map<String,String> getProperties()
    • getConsumer

      public KafkaProperties.Consumer getConsumer()
    • getProducer

      public KafkaProperties.Producer getProducer()
    • getListener

      public KafkaProperties.Listener getListener()
    • getAdmin

      public KafkaProperties.Admin getAdmin()
    • getStreams

      public KafkaProperties.Streams getStreams()
    • getSsl

      public KafkaProperties.Ssl getSsl()
    • getJaas

      public KafkaProperties.Jaas getJaas()
    • getTemplate

      public KafkaProperties.Template getTemplate()
    • getSecurity

      public KafkaProperties.Security getSecurity()
    • getRetry

      public KafkaProperties.Retry getRetry()
    • buildConsumerProperties

      @Deprecated(since="4.2.0", forRemoval=true) public Map<String,Object> buildConsumerProperties()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 4.2.0 for removal in 4.4.0 in favor of KafkaConfigBuilder
      Create an initial map of consumer properties from the state of this instance.

      This allows you to add additional properties, if necessary, and override the default kafkaConsumerFactory bean.

      Returns:
      common and consumer properties initialized with the customizations defined on this instance
    • buildProducerProperties

      @Deprecated(since="4.2.0", forRemoval=true) public Map<String,Object> buildProducerProperties()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 4.2.0 for removal in 4.4.0 in favor of KafkaConfigBuilder
      Create an initial map of producer properties from the state of this instance.

      This allows you to add additional properties, if necessary, and override the default kafkaProducerFactory bean.

      Returns:
      common and producer properties initialized with the customizations defined on this instance
    • buildAdminProperties

      @Deprecated(since="4.2.0", forRemoval=true) public Map<String,Object> buildAdminProperties()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 4.2.0 for removal in 4.4.0 in favor of KafkaConfigBuilder
      Create an initial map of admin properties from the state of this instance.

      This allows you to add additional properties, if necessary, and override the default kafkaAdmin bean.

      Returns:
      common and admin properties initialized with the customizations defined on this instance
    • buildStreamsProperties

      @Deprecated(since="4.2.0", forRemoval=true) public Map<String,Object> buildStreamsProperties()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 4.2.0 for removal in 4.4.0 in favor of KafkaConfigBuilder
      Create an initial map of streams properties from the state of this instance.

      This allows you to add additional properties, if necessary.

      Returns:
      common and streams properties initialized with the customizations defined on this instance