postwait / node-amqp

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

[Bug] creating exchanges modify passed options #267

Open jgato opened 10 years ago

jgato commented 10 years ago

whenever you call to create exchange passing the options as an object (JSON) this is modified internally. Something like that:

[code] exchange_options = { type : "fanout", durable: true, confirm: true }; connection.exchange(name = exchangeName, options = exchange_options, function(exchange) { logger.debug("exchange options ", exchange_options); }); [/code]

After that exchange_options has a new attribute (autoDelete:true), I guess because it is the default way of working. But, I think that internally, the function should take care of not modifying the configuration object.

By the moment my solution is to stringify (JSON.stringify(exchange_options)) the object. That way, I am not passing and object that could be modified internally.

jgato commented 10 years ago

I fear that stringify does not resolve the issue, the function receives an string and does not understand the parameters.