Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

cannot get queue from non default virtual host #68

ronnyg21 opened this Issue Feb 9, 2012 · 1 comment


None yet
2 participants

ronnyg21 commented Feb 9, 2012

using 0.1.1

I've created virtual host "dev" on my rabbit instance. I cannot connect to queue for anything other than default "/" virtual host. I do not get an error if I connect to any queue on "/" vhost.

var queueName = "devqueue";
 var connection = amqp.createConnection({'host': 'localhost', 'port': 5672, 'vhost' : 'dev'});

 connection.on('ready', function() {
        var args = {'exclusive': false, 'autoDelete': false, 'durable' : true};
        var q = connection.queue(queueName , args);

yields the error

        throw e; // process.nextTick error, or 'error' event on first tick
    at Connection._onMethod (/opt/apps/amqp/scripts/node_modules/amqp/amqp.js:995:15)
    at AMQPParser.onMethod (/opt/apps/amqp/scripts/node_modules/amqp/amqp.js:811:12)
    at AMQPParser._parseMethodFrame (/opt/apps/amqp/scripts/node_modules/amqp/amqp.js:456:10)
    at AMQPParser.execute (/opt/apps/amqp/scripts/node_modules/amqp/amqp.js:206:20)
    at Connection.<anonymous> (/opt/apps/amqp/scripts/node_modules/amqp/amqp.js:851:12)
    at Connection.emit (events.js:67:17)
    at TCP.onread (net.js:329:14)

shimaore commented Dec 21, 2012

I suspect there is a disconnect between how RabbitMQ wants vhosts and how node-amqp is handling them (for example in its URL parsing).
In RabbitMQ (2.8.4 in my case) the vhosts are clearly labelled with a starting slash: /dev would be correct in the example above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment