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.
source share