title: Writing data on a Kafka compacted topic - how to set the record key
body: <p>Using spring cloud dataflow, I'm trying to replicate data from a database using a Kafka compacted topic. For this reason I need to set the key of the record while producing records into the topic (called foo).</p>
  
  <pre><code>kafka-topics --zookeeper localhost:2181 --create --topic foo --replication-factor=1 --partitions 3 --config cleanup.policy=compact 
  
  
  
  stream create --name foo --deploy --definition "jdbc --spring.datasource.url=jdbc:postgresql://localhost:5432/chiodonia --spring.datasource.driver-class-name=org.postgresql.Driver --jdbc.max-rows-per-poll=10 --jdbc.query='select id, value from foo where seen is null' --jdbc.split=true --jdbc.update='update foo set seen=current_timestamp where id in (:id)' --trigger.fixed-delay=5 --trigger.time-unit=SECONDS | header-enricher --headers='recordkey=payload.id' &gt; :foo --spring.cloud.stream.kafka.bindings.output.producer.messageKeyExpression=headers['recordkey']" 
  </code></pre>
  
  <p>Anyone able to set the key of records into kafka using spring cloud dataflow?</p>