peterprib / node-red-contrib-kafka-manager

Implement
GNU General Public License v3.0
22 stars 12 forks source link

Set message key when publishing #50

Closed chainhead closed 1 year ago

chainhead commented 1 year ago

How do I set message key when publishing messages to a topic?

peterprib commented 1 year ago

attribute on publish definition. If y want more dynamic that is set per message that is a feature request. Should be relatively easy to achieve but needs to be a reasonable demand or reason.

chainhead commented 1 year ago

An example, please?

peterprib commented 1 year ago

see node-red-contrib-kafka-manager/documentation/producer.JPG

chainhead commented 1 year ago

My key is a UUID so, I need to set it on a per message basis. Do we set the key with something like msg.payload.key=?

How does "relatively easy to achieve" look like? I would like to take a stab?

chainhead commented 1 year ago

Set msg.key for dynamic setting of message key as described here.

peterprib commented 1 year ago

The method I will do will be more generic and may apply to other attributes as have a request to make some attributes set at configuration layer which I can see as valuable from a portability aspect.