title: How to specify key for kafka producer in apache nifi?
body: <p>I have simple pipeline using apache nifi and i want to publish some messages in kafka topic using existing kafka puplisher processor.
  <a href="https://i.stack.imgur.com/JTO0f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JTO0f.png" alt="enter image description here"></a></p>
  
  <p>The problem is how to specify kafka key using apache nifi expression language?
  I tired something like <code>${message:jsonPath('$.key')}</code> but, of course, i got an error because object <code>message</code> does not exist.
  <a href="https://i.stack.imgur.com/yNVgF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yNVgF.png" alt="enter image description here"></a></p>
  
  <p>I also tried to use <code>filename</code> object which is something like a default object name for input messages, but it didn't help </p>
  
  <hr>
  
  <p>Using another kafka publisher processor it is possible by setting <code>message key field</code> property, but what about <code>PublishKafka</code> processor?</p>