Giter Site home page Giter Site logo

Comments (5)

michaelklishin avatar michaelklishin commented on May 20, 2024

encodeBasicPublish suggests it was a published message, so I guess it's routing key or one of the headers that's not a string (header values can be anything, though).

from amqplib.

squaremo avatar squaremo commented on May 20, 2024

Yes, it's the routing key being undefined or null I think.

I actually go to a bit of trouble to generate code that detects invalid values and raise artisinal errors with the field name and a little certificate of ownership and so on -- but the code generating code has a bug! Which means this makes it past those checks, then fails on some Node.JS core library with a bland, off-the-shelf error message.

For the minute, make sure you're at least passing an empty string in as the routingKey argument to publish.

from amqplib.

squaremo avatar squaremo commented on May 20, 2024

OK, fixed the bug in the code generation, and hand-turned some better error messages.

Just to be clear, it is supposed to be fine to pass undefined for either of the routingKey and exchange arguments to #publish, since they both have a default of "" in the protocol. Supplying null for either will result in an error though. In other words, undefined means "I don't have a value for you", and null means "Who's Tony Hoare?".

from amqplib.

mxriverlynn avatar mxriverlynn commented on May 20, 2024

undefined vs null: make sense. thanks, yo! :)

from amqplib.

squaremo avatar squaremo commented on May 20, 2024

Derick, would you give this and #49 a sanity check using master branch? I need to write some tests, for this one especially, and it would be good to have your confirmation too.

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.