How to stop the binding to the default exchange AMQP?

Each time I bind the AMQP queue to an exchange, it automatically binds to a direct exchange by default.

Here we use the code using the rabbitMQ server and node.js:

var amqp = require('amqp'); var connection = amqp.createConnection({host:'localhost'}); connection.on('ready', function(){ var q = connection.queue('test_queue_name'); var exc = connection.exchange('test_exchange', { autoDelete:true }); q.bind('test_exchange', 'test.key'); }); 

Here's the console output when using the "rabbitmqctl list_bindings" command:

 Listing bindings ... exchange test_queue_name queue test_queue_name [] test_exchange exchange test_queue_name queue test.key [] ...done. 
+4
source share
1 answer

RabbitMQ automatically associates each queue with a default exchange with a routing key in the same way as the queue name.

From docs

The default exchange is a direct exchange without a name (empty line) previously announced by the broker. It has one special property that makes it very useful for simple applications: each queue created is automatically bound to it using a routing key that matches the queue name.

I am sure this is part of the AMQP specification.

+2
source

All Articles