haf/NLog.RabbitMQ — pull request #4 by nslowes (2012-08-08 16:45:52+00:00)
Title: Fixing bug involving exchange declaration

I found a surprising bug when I misconfigured the NLog target to use an exchange which the user did not have access to. The exchange declare command would throw an exception, which caused the target to keep on opening new connections to the RabbitMQ server on every log write. This eventually starves the RabbitMQ server of socket descriptors and no one else is able to open new connections to the server.

Adding a catch around the exchange declaration to dispose of the model solved the problem, though there may be a better solution. I don't entirely understand what is happening in the RabbitMQ Client when that error occurs.