I started to use rabbit.js to connect to RabbitMQ from a node.js application.
I'm blocked at:
Error: Channel closed by server: 403 (ACCESS-REFUSED) with message "ACCESS_REFUSED -operation not permitted on the default exchange"
at Channel.C.accept (/.../rabbit.js/node_modules/amqplib/lib/channel.js:398:24)
at Connection.mainAccept [as accept] (/.../rabbit.js/node_modules/amqplib/lib/connection.js:63:33)
at Socket.go (/.../rabbit.js/node_modules/amqplib/lib/connection.js:448:48)
at Socket.EventEmitter.emit (events.js:92:17)
...
which is expected, since the instance of RabbitMQ I use is configured to require the publishers and subscribers to provide credentials before being able to use the message queue, and guest account is disabled.
The official documentation of rabbit.js has no mention of credentials. Google searches for “rabbit.js specify credentials” and “rabbit.js login password” were inconclusive.
Are credentials supported by rabbit.js? If not, what other RabbitMQ clients for node.js support them?
Create an account in their website and create an instance. Once you create an instance, click on the “RabbitMQ Manager” button. This should open the standard RabbitMQ admin console. Let us create a durable queue in the same console.
rabbit. js: message patterns in node. js using RabbitMQ.
In order for a client to interact with RabbitMQ it must first open a connection. This process involves a number of steps: Application configures the client library it uses to use a certain connection endpoint (e.g. hostname and port) The library resolves the hostname to one or more IP addresses.
So I never used rabbit.js myself, but after diving into the code, it seems to be using amqplib. The code that parses it can be seen here and it seems it's calling the standard nodejs URL module. So perhaps you can try something like this:
amqp://user:[email protected]/vhost
Hope it helps!
Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With