# Error in node "amqp2 in" when getting new messages

**URL:** <https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914>\
**Category:** General\
**Created:** [20 October 2019 04:47 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914 "2019-10-20T04:47:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/terry/32/13369_2.png) [@Terry](https://discourse.nodered.org/u/Terry)\
**Post date:** [20 October 2019 04:47 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/1 "2019-10-20T04:47:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 October 2019 07:36 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/2 "2019-10-20T07:36:10Z")

</div>

If you go to the [flow tab](https://flows.nodered.org) 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

---

<div class="post-metadata">

**Author:** ![Terry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/terry/32/13369_2.png) [@Terry](https://discourse.nodered.org/u/Terry)\
**Post date:** [20 October 2019 14:09 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/3 "2019-10-20T14:09:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Terry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/terry/32/13369_2.png) [@Terry](https://discourse.nodered.org/u/Terry)\
**Post date:** [22 October 2019 09:50 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/4 "2019-10-22T09:50:13Z")

</div>

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 msg.delivery.link;"  
Reason: msg.delivery is a resource handler and it cannot be cloned. Just remove the protected attribute of it.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [22 October 2019 11:30 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/5 "2019-10-22T11:30:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Terry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/terry/32/13369_2.png) [@Terry](https://discourse.nodered.org/u/Terry)\
**Post date:** [22 October 2019 14:50 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/6 "2019-10-22T14:50:04Z")

</div>

I did, but got no reply now.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [22 October 2019 15:30 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/7 "2019-10-22T15:30:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Terry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/terry/32/13369_2.png) [@Terry](https://discourse.nodered.org/u/Terry)\
**Post date:** [23 October 2019 08:53 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/8 "2019-10-23T08:53:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Terry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/terry/32/13369_2.png) [@Terry](https://discourse.nodered.org/u/Terry)\
**Post date:** [23 October 2019 09:03 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/9 "2019-10-23T09:03:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [23 October 2019 09:06 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/10 "2019-10-23T09:06:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Terry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/terry/32/13369_2.png) [@Terry](https://discourse.nodered.org/u/Terry)\
**Post date:** [23 October 2019 09:15 UTC](https://discourse.nodered.org/t/error-in-node-amqp2-in-when-getting-new-messages/16914/11 "2019-10-23T09:15:53Z")

</div>

I made the request pull. Thanks.
