Giter Site home page Giter Site logo

Comments (6)

cressie176 avatar cressie176 commented on June 12, 2024

Hi @GlennButera,

I haven't come across this before, but other RabbitMQ issues I've found online suggest this problem can occur when publishing from different threads using the same channel. If I understand correctly, a message published by one thread is being mutated by another thread before it is sent, invalidating it.

While Node.js isn't multithreaded, you can get this behaviour when sharing data between asynchronous code. You're using JSON.stringify to serializse _packet so I believe that must be safe, however you are passing in _options, so potentially that is being mutated. Can you try deep cloning _options immediately so that neither it, or the headers sub-document have any chance to be mutated?

from amqplib.

cressie176 avatar cressie176 commented on June 12, 2024

You could also try not sharing the channel. This will be a little slower though.

from amqplib.

GlennButera avatar GlennButera commented on June 12, 2024

@cressie176 I have tried "deep cloning" the _options immediately wherever it was being used by doing a JSON.parse(JSON.stringify(_options));. The issue still occurred.

from amqplib.

cressie176 avatar cressie176 commented on June 12, 2024

Hi @GlennButera,

I've created what I hoped would be a minimal reproducible example based on your description of the problem, but it works fine. Are you able to fork this, test it in your environment, and make the necessary amends to reproduce the frame error please?

FYI, the example uses confirm channels, but I also tried with regular ones.

from amqplib.

cressie176 avatar cressie176 commented on June 12, 2024

Any update @GlennButera?

from amqplib.

GlennButera avatar GlennButera commented on June 12, 2024

@cressie176 My apologies, we were not able to reproduce with the minimal reproducible example. We have decided to move on from the issue and are going about a different solution that will remove this issue from our code by not leveraging RabbitMQ in the same way.

from amqplib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.