GoogleCloudPlatform / node-red-contrib-google-cloud

Node-RED nodes for Google Cloud Platform
Apache License 2.0
90 stars 57 forks source link

Send a message with attributes PubSub-Out node #130

Open bboinali opened 7 months ago

bboinali commented 7 months ago

We can not send a message with attribute with PubSub-Out node. Is there a reason ? Thanks in advance

robert-king commented 5 months ago

we would love this feature added. I agree it's missing for OUT and is only there for IN

i can see on this line of code it's missing msg.attributes

https://github.com/GoogleCloudPlatform/node-red-contrib-google-cloud/blob/87b99fcb396601dea244e8134e018bd547c71ac9/pubsub-out.js#L88C6-L88C73

await topic.publish(RED.util.ensureBuffer(msg.payload));

it should use msg.attributes somewhere.

it should be consistent with the pubsub-in experience which does allow attributes:

https://github.com/GoogleCloudPlatform/node-red-contrib-google-cloud/blob/87b99fcb396601dea244e8134e018bd547c71ac9/pubsub-in.js#L86