title: Apache Nifi: Is there a way to publish messages to kafka with a message key as combination of multiple attributes?
body: <p>I have a requirement where I need to read a CSV and publish to Kafka topic in Avro format. During the publish, I need to set the message key as the combination of two attributes. Let's say I have an attribute called id and an attribute called group. I need my message key to be id+"-"+group. Is there a way I can achieve this in Apache nifi flow? Setting the message key to a single attribute works fine for me. </p>
  
  <p><a href="https://i.stack.imgur.com/MQtHB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MQtHB.png" alt="publishKafkaRecord Processor"></a></p>
  
  <p><a href="https://i.stack.imgur.com/6AhFi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6AhFi.png" alt="Flow"></a></p>