title: Spring Kafka Configuration for 2 different kafka cluster setups
body: <p>In one of our spring-boot based services, we intended to connect to 2 different kafka clusters simultaneously. These clusters each have their own set of bootstrap-servers, topic configurations etc. They are nowhere related to each other as was the case in <a href="https://stackoverflow.com/questions/52476399/spring-kafka-consumer-for-2-kafka-cluster">this question</a>.</p>
  <p>I will have different types messages to be read from each cluster on different topic names. There may or may not be multiple producers connecting to both the clusters from this service but we will surely have at least one consumer per cluster.</p>
  <p>I would like to know how can I define properties in application.yml to cater to this setup so that I can just use 2 different <code>KafkaProperties</code> objects to create 4 container factories (2 consumer, 2 producer). The rest, I believe, should be pretty straight forward as I would need to use the relevant factory to create a particular container/listener/kafkaTemplate as per the business requirements.</p>