Error in node "amqp2 in" when getting new messages

I got an error message like this, "error: Queue onMessage consumer function returned error: Cannot assign to read only property 'writeQueueSize' of object '#' module=amqp-ts"

In my flow, I have a node of "amqp2 in". This node can connect to a rabbbitmq server and subscribe to a queue. But when messages are published, the node-red console shows this error message.

On rabbitmq server, the messages have been consumed and removed after the error occurs.

Node version: v10.16.3
NPM version: 6.9.0
Node-red version: v1.0.2

Can someone help?

If you go to the flow tab on this site and lookup the node, you will notice that it hasn't been updated in almost 2 1/2 years.

If you click on the View on GitHub link you will see a link for Issues of which there are 4 the latest from Feburary 2018 which leads me th think this node has been abandoned.

That leaves you with the choice of

  1. adding your own issue hoping the author will fix it
  2. find a different node (I have no idea if there is one or - if there is - what it would be called)
  3. forking the node and fixing it yourself

Okay, I will add my issue to github.
And I will also try other solutions. I just need a service which can translate both AMQP and MQTT to each other. Maybe I can use Apache NiFi as another low-code platform to make the service. Thanks for your advice.

I found another node for AMQP which is "node-red-contrib-rhea". This node is based on the lib of rhea which supports AMQP 1.0 protocol. I tried this node and it has almost the same error. I debugged it and revised its code. Now it works.

File: node-red/node_modules/node-red-contrib-rhea/rhea/rhea.js
Action: Add a line before line 262, the code is "delete;"
Reason: is a resource handler and it cannot be cloned. Just remove the protected attribute of it.

I hope you’ll open an issue in the github repository.

I did, but got no reply now.

How have you made it easier tfor the suthor to mpliment the change? Have you created a pull request with your fix which would make it easier for the author to add the change into the code.

I just opened an issue on github yesterday and I get no reply to close the issue now.
As you advised, I forked the revised source code just now.

Well, I just forked to create a project on my own account and made changes to it. I have committed all the changes to my account. Do I need to do more steps to commit it to the author?

If you offer the improvements you made back to the author, the community benefits from better quality software.

The way to do this is with a pull request, there are lots of tutorials online that show how to do this.

I made the request pull. Thanks.

1 Like