[rabbitmq-discuss] .Net Cilent/1.8.0: IModel.QueueDelete not working?
Adam Kaminiecki
adamka at dgt.com.pl
Thu Nov 25 08:36:49 GMT 2010
I had a similar poroblem but Emile explaint it to me:
"The AMQP 0-9-1 spec requires that the broker raise a channel exception
if a publisher attempts to publish to a non-existent exchange.
It is unusual for publishers to deal with the risk of an exchange
disappearing, because exchanges are normally long-lived. Publishers must
be prepared to redeclare exchanges or recover from channel exceptions in
the presence of such risk.
If you explain the reason for consumers deleting exchanges then I may be
able to suggest an alternative messaging pattern.
As a preventative measure you can use permissions to prevent clients
from deleting exchanges, or use server-assigned names to make them
undiscoverable via AMQP.
Regards
Emile"
Regards Adam
W dniu 2010-11-25 01:16, Ovidiu Deac pisze:
> Hi again,
>
> I'm back with more info. Yes, the queue is still there.
>
> I've got the chance to do some cleanup of the code and some debugging
> and it seems that I get an exception when I try delete an exchange
> that doesn't exist and then all the following operations throw the
> same exception, even if they try to delete queues that does exist.
>
> The following code reproduces the problem:
>
> IModel _channel;
> //....set up _channel
>
> System.Console.WriteLine("deleting the exchange...");
> try
> {
> _channel.ExchangeDelete("x",false, false);
> } catch(Exception ex)
> {
> System.Console.WriteLine(ex.Message);
> }
>
> System.Console.WriteLine("deleting the queue...");
>
> try
> {
> _channel.QueueDelete("q", false, false, false);
> } catch(Exception ex)
> {
> System.Console.WriteLine(ex.Message);
> }
>
> Running this code when the exchange x DOESN'T exist and the queue q
> DOES exist gives me the following output:
>
> deleting the exchange...
> The AMQP operation was interrupted: AMQP close-reason, initiated by
> Peer, code=404, text="NOT_FOUND - no exchange 'x' in vhost '/'",
> classId=40, methodId=20, cause=
> deleting the queue...
> The AMQP operation was interrupted: AMQP close-reason, initiated by
> Peer, code=404, text="NOT_FOUND - no exchange 'x' in vhost '/'",
> classId=40, methodId=20, cause=
>
>
> So it seems that one error on the channel doesn't allow me to do any
> other operations using that channel. Is there any possibility to reuse
> the channel?
>
> Thanks,
> Ovidiu
>
> On Fri, Nov 19, 2010 at 2:39 PM, Matthias Radestock
> <matthias at rabbitmq.com> wrote:
>> Ovidiu,
>>
>> On 19/11/10 10:52, Ovidiu Deac wrote:
>>> Thanks for the answer. I don't get any errors. At least I don't see any.
>> So what *are* you seeing? Does the QueueDelete call succeed but the queue is
>> still there? That can only happen if the queue gets redeclared by something
>> else.
>>
>>
>> Matthias.
>>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the rabbitmq-discuss
mailing list