[rabbitmq-discuss] .Net Cilent/1.8.0: IModel.QueueDelete not working?

Ovidiu Deac ovidiudeac at gmail.com
Thu Nov 25 10:34:00 GMT 2010


I am doing some functional automated testing which involves setup the
environment (i.e. creating a brand new exchange, queues, do the
bindings), run the module that needs test and then clear the
environment.

So I don't have a problem with the exchange deletion. My real problem
is the fact that after an error encountered while deleting the
exchange I can't do any other operations on that channel.

ovidiu

On Thu, Nov 25, 2010 at 10:36 AM, Adam Kaminiecki <adamka at dgt.com.pl> wrote:
> 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.
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>


More information about the rabbitmq-discuss mailing list