Spring Cloud Streams not setting the kafka key in the message?
<p>The story is like this. I have a kafka broker and a particular object (which I jsonify to send through my topics) which has an ID I want to use as a key.</p>

<p>Currently I'm using the 'partitionKeyExtractorClass' configuration to set the class which extracts the ID and returns it as the key.</p>

<p>It looks like this:</p>

<pre><code>def extractKey(Message&lt;?&gt; message) {
    log.info('Extracting key from message')
    String id = new JsonSlurper().parseText(new String(message.payload)).properties.id
    log.info("Got = ${id}")

    return id
}
</code></pre>

<p>My actual problem is that when I browse the message on the topic the ConsumerRecord which holds my message says that the key is null...</p>

<p>Is this a bug? Am I doing something wrong? Documentation on this doesn't go further than this.</p>