postwait / node-amqp

[UNMAINTAINED] node-amqp is an AMQP client for nodejs
MIT License
1.69k stars 357 forks source link

Auto Delete option for Default Exchange #312

Open dchankhour opened 10 years ago

dchankhour commented 10 years ago

Currently there does not seem to be an option to create the Default Topic Exchange with an Auto Delete setting.

Currently i have made the following change under the following line of code:

https://github.com/postwait/node-amqp/blob/master/lib/connection.js#L292

if (name !== '' && options.autoDelete === undefined) options.autoDelete = false;

And updated the createConnection function to have the option:

var conn = amqp.createConnection({ url: config.rabbit.url[app.get('env')] }, { defaultExchangeName: 'AppServerWorkExchange', autoDelete: false });

Can i propose making the auto Delete as an option to be passed to the CreateConnection method.

Thanks.