title: How can we configure value.subject.name.strategy for schemas in Spring Cloud Stream Kafka producers, consumers and KStreams?
body: <p>I would like to customize the naming strategy of the Avro schema subjects in Spring Cloud Stream Producers, Consumers and KStreams.</p>
  
  <p>This would be done in Kafka with the properties <code>key.subject.name.strategy</code> and <code>value.subject.name.strategy</code> -> <a href="https://docs.confluent.io/current/schema-registry/serializer-formatter.html#subject-name-strategy" rel="noreferrer">https://docs.confluent.io/current/schema-registry/serializer-formatter.html#subject-name-strategy</a></p>
  
  <p>In a native Kafka Producer this works:</p>
  
  <pre><code>
  private val producer: KafkaProducer&lt;Int, Customer&gt;
  
      init {
          val props = Properties()
          ...
          props[AbstractKafkaAvroSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG] = "http://localhost:8081"
          props[AbstractKafkaAvroSerDeConfig.VALUE_SUBJECT_NAME_STRATEGY] = TopicRecordNameStrategy::class.java.name
          producer = KafkaProducer(props)
      }
  
      fun sendCustomerEvent(customer: Customer) {
          val record: ProducerRecord&lt;Int, Customer&gt; = ProducerRecord("customer", customer.id, customer)
          producer.send(record)
      }
  </code></pre>
  
  <p>However I cannot find how to do this in Spring Cloud Stream. So far I have tried this in a producer:</p>
  
  <pre><code>spring:
    application:
      name: spring-boot-customer-service
    cloud:
      stream:
        kafka:
          bindings:
            output:
              producer:
                configuration:
                  key:
                    serializer: org.apache.kafka.common.serialization.IntegerSerializer
                  value:
                    subject:
                      name:
                        strategy: io.confluent.kafka.serializers.subject.TopicRecordNameStrategy
  </code></pre>
  
  <p>Apparently Spring Cloud uses it's own subject naming strategy with the interface <code>org.springframework.cloud.stream.schema.avro.SubjectNamingStrategy</code> and only one subclass: <code>DefaultSubjectNamingStrategy</code>.</p>
  
  <p>Is there declarative way of configuring <code>value.subject.name.strategy</code> or are we expected to provide our own <code>org.springframework.cloud.stream.schema.avro.SubjectNamingStrategy</code> implementation and the property <code>spring.cloud.stream.schema.avro.subject-naming-strategy</code>?</p>