abreits / node-red-contrib-amqp

Node-RED AMQP input and output nodes
16 stars 19 forks source link

[AmqpOut node] Publish messages with routing key never works through node definition "Routing key" option #3

Closed exogenesick closed 8 years ago

exogenesick commented 8 years ago

In AmqpOut node publishing messages with specified routing key now works only through msg.topic. Never works with node configuration dialog/definition which is explained here https://github.com/abreits/node-red-contrib-amqp#output-amqp.

It's because of mistake located here: https://github.com/abreits/node-red-contrib-amqp/blob/master/src/nodejs/amqp.ts#L98

Should be:

node.topic = n.routingkey;

instead of:

node.topic = n.topic;

When I debug node definition (AmqpOut node n parameter) it shows me this:

{ id: 'bb1c6ed3.44e39',
  type: 'amqp out',
  z: '1dfb0672.e204fa',
  name: 'producer',
  routingkey: 'a.b.c',
  iotype: '3',
  ioname: 'requests',
  server: '6100766a.9eff88',
  x: 586.1817512512207,
  y: 336.9090938568115,
  wires: [] }

Above debug object contains routingkey property which is proper Routing key option of node definition. Property topic not exists in this object.

Pull request here #2

abreits commented 8 years ago

fixed!