title: Can I completely disable bus functionality in Spring Cloud?
body: <p>Currently I have the following configuration for local development. In our cloud environment where we deploy to GCP, obviously some of these properties are then activated because they're needed. We use Spring Cloud Bus specifically to send events between applications, e.g. to replace properties.</p>
  <pre><code>spring:
      cloud:
       gcp:
        config.enabled: false
        core.enabled: false
        logging.enabled: false
       trace.enabled: false
        pubsub.enabled: false
      bus:
        enabled: false
  </code></pre>
  <p>When doing this, things aren't fully disabled. Some components are still loaded and attempt bean creation. Several components in spring-cloud-stream are fully loaded. I even get some warnings:</p>
  <pre><code>2022-05-24 13:21:46.744  WARN [       restartedMain] onConfiguration$FunctionBindingRegistrar : You have defined function definition that does not exist: busConsumer
  2022-05-24 13:21:48.864  INFO [       restartedMain] o.s.c.s.binder.DefaultBinderFactory      : Creating binder: pubsub
  </code></pre>
  <p>As a result, it seems like not all components are properly disabled. I also found an <a href="https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1089" rel="nofollow noreferrer">old issue</a> indicating that this behavior is expected. We actually ran into issue with some missing beans due to conflict with other another library (coffee-boots), because not all components were disabled properly and still attempted to load some beans.</p>
  <p>Is there any way to properly disable all functionality for local development?
  When debugging, I stumbled upon <code>spring.cloud.stream.function.autodetect=false</code>, but that did not help - for example if any of your beans implement <code>java.lang.Function</code>, <code>spring-cloud-stream-function</code> will interact with it whether it is disabled or not.</p>