Hi,
It seems like the current code doesn't deal with queues that have been created using non-standard arguments very well. The code in SimpleMessageListenerContainer.cs, line 203 always does:
channel.QueueDeclare(name);
So for any queue that was created using anything but the standard constructor (i.e. it's a permanent and durable queue for example) this statement will throw an exception.
I think the best thing to do is to test if the queue already exists, and if so don't do the QueueDeclare(), and if not do the current. Adding that would require us to extend the interfaces somewhere to have a function QueueExists(name) function. Given the current RabbitMQ.Client setup there's however no suitable method on IModel to use for this and one would have to do something along the lines of the Rabbit.Admin implementation. I believe Qpid has some methods in its API to check for queue properties.
Or add a flag to decide if the queue is created at all?


Reply With Quote