title: Spring Cloud Stream Kafka Binder Configuration update at runtime
body: <p>I am using Spring cloud stream along with Kafka binders to connect to a Kafka cluster using SASL. The SASL config looks as follows:</p>
  <pre><code>spring.cloud.stream.kafka.binder.configuration.sasl.mechanism=SCRAM-SHA-512
  spring.cloud.stream.kafka.binder.configuration.sasl.jaas.config= .... required username=&quot;...&quot; password=&quot;...&quot;
  spring.cloud.stream.kafka.binder.configuration.security.protocol=SASL_SSL
  </code></pre>
  <p><strong>I want to update the username and password programmatically/at runtime, how can I do that in Spring Cloud Stream using Spring Kafka binders?</strong></p>
  <p><em>Side note:
  Using <code>BinderFactory</code> I can get reference to <code>KafkaMessageChannelBinder</code> which has <code>KafkaBinderConfigurationProperties</code>, in its <code>configuration</code> hashmap I can see those configurations but I want to know how can I update the configuration at runtime such that those changes are reflected in the connections as well?</em></p>
  <pre><code>@Autowired
  BinderFactory binderFactory
  
  ....
  
  public void foo()
  {
      KafkaMessageChannelBinder k = (KafkaMessageChannelBinder)binderFactory.getBinder(null, MessageChannel.class);
      // Using debugger I inspected k.configurationProperties.configuration which has the SASL properties I need to update
  }
  </code></pre>