title: How to configure min.insync.replicas parameter on Spring Kafka Producer?
body: <p>On a Java Spring application, I'm configuring a Producer to use <a href="https://kafka.apache.org/documentation/#acks" rel="nofollow noreferrer">Acks</a> and must set <a href="https://kafka.apache.org/documentation/#min.insync.replicas" rel="nofollow noreferrer">min.insync.replicas</a> parameter too.</p>
  <p>I got it setup Acks using:</p>
  <pre><code>configProps.put(ProducerConfig.ACKS_CONFIG, kafkaAcks);
  </code></pre>
  <p>but I can't found the <code>min.insync.replicas</code> property on <code>ProducerConfig</code>. Looking on <a href="https://docs.spring.io/spring-kafka/docs/current/reference/html/" rel="nofollow noreferrer">Kafka Spring Docs</a> I not found the property related with <code>min.insync.replicas</code>.</p>
  <p>So, how I configure <code>min.insync.replicas</code> on a Kafka Spring application?</p>
  <pre><code>    @Bean
  public KafkaTemplate&lt;String, GenericRecord&gt; kafkaTemplate() {
      return new KafkaTemplate&lt;&gt;(producerFactory());
  }
  
  public ProducerFactory&lt;String, GenericRecord&gt; producerFactory() {
      return new DefaultKafkaProducerFactory&lt;&gt;(getProducerGenericRecordConfigurations());
  }
  
  private Map&lt;String, Object&gt; getProducerGenericRecordConfigurations() {
      Map&lt;String, Object&gt; configProps = new HashMap&lt;&gt;();
      configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaBootstrapServerUrl);
      configProps.put(KafkaAvroDeserializerConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistryURL);
      configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
      configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, KafkaAvroSerializer.class);
      configProps.put(ProducerConfig.ACKS_CONFIG, kafkaAcks);
      return configProps;
  }
  </code></pre>