title: How to disable all Kafka related auto configuration from yaml/properties file in spring-boot-2 without removing dependencies?
body: <p>I have create a spring-boot-2 gradle project, also in <code>build.gradle</code> file i have added Kafka related dependency which given below.</p>
  
  <pre><code>dependencies {
      implementation 'org.springframework.cloud:spring-cloud-starter-zipkin'
      compile 'org.springframework.cloud:spring-cloud-starter-bus-kafka'
  }
  </code></pre>
  
  <p>now i want to disable all Kafka related Auto configuration from <code>application.yaml</code>
  file for that i have tried given below code in my yaml file.</p>
  
  <pre><code>spring:
    autoconfigure:
        exclude:
          - org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
  </code></pre>
  
  <p>After implementing above things still the Kafka got Auto-configured and start integration of Kafka with the application.</p>
  
  <p>Also i have tried below code but this is also not working for me.</p>
  
  <pre><code>@SpringBootApplication
  @EnableAutoConfiguration(exclude = KafkaAutoConfiguration.class)
  public class ApiGatewayApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(ApiGatewayApplication.class, args);
      }
  
  }
  </code></pre>
  
  <p>Now please can any one help me out, how can i disable all auto configuration related to kafka from yaml/properties file ?  </p>
  
  <p>Thanks,</p>