[rabbitmq-discuss] .net client and Subscription

Emile Joubert emile at rabbitmq.com
Mon Jul 5 17:08:15 BST 2010


Hi Andrius,

Thanks for bringing this to our attention. The less-than-ideal behaviour
you describe is caused partly by changes that were introduced during
AMQP 0.9.1 compatibility. We also did not fully anticipate your use of
the Subscription abstraction, which is to declare queues and exchanges
outside the abstraction.

Your code will continue to work on version 1.7.2 while we consider how
to address the problem. You could also implement your own version of
Subscription, which is a very slim class. By declaring your own queues
and exchanges you are already doing much of that work.

Regards

Emile


On 05/07/10 16:21, Andrius Norkaitis wrote:
> Same thing with Exchange. Look at the Subscription.cs source:
> 
>  
> 
> public void Bind(string exchangeName, string exchangeType, string
> routingKey)
> 
>         {
> 
>             m_model.ExchangeDeclare(exchangeName, exchangeType);
> 
>             m_model.QueueBind(m_queueName, exchangeName, routingKey,
> false, null);
> 
>         }
> 
>  
> 
> If I use other exchange than default (non-passive, non-durable,
> non-autodelete, and non-internal) I got the exception.
> 
>  
> 
>  
> 
>  
> 
> *From:* rabbitmq-discuss-bounces at lists.rabbitmq.com
> [mailto:rabbitmq-discuss-bounces at lists.rabbitmq.com] *On Behalf Of
> *Andrius Norkaitis
> *Sent:* Monday, July 05, 2010 5:51 PM
> *To:* rabbitmq-discuss at lists.rabbitmq.com
> *Subject:* [rabbitmq-discuss] .net client and Subscription
> 
>  
> 
> Hi. As from 1.8 there is queue equivalence verification I started
> getting exception when I declare queue and later use it with
> Subscription class.
> 
>  
> 
> ch.QueueDeclare(clientID, false, false, true, true, false, null);
> 
> var sub = new Subscription(ch, clientID, false, RabbitMQexchange,
> RabbitMQexchangeType, "");
> 
>  
> 
> As you can see I declare queue with Autodelete flag set to TRUE.
> 
> But if I specify queue name, Subscriber tries to re-declare this queue
> with autodelete set to FALSE and exception rises.
> 
>  
> 
> Check the code from the client source:
> 
>  
> 
>   public Subscription(IModel model, string queueName, bool noAck)
> 
>         {
> 
>             m_model = model;
> 
>             if (queueName == null || queueName.Equals("")) {
> 
>                 m_queueName = m_model.QueueDeclare();
> 
>                 m_shouldDelete = true;
> 
> *            } else {*
> 
> *                m_queueName = m_model.QueueDeclare(queueName);*
> 
> *                m_shouldDelete = false;*
> 
> *            }*
> 
>             m_consumer = new QueueingBasicConsumer(m_model);
> 
>             m_consumerTag = m_model.BasicConsume(m_queueName, m_noAck,
> null, m_consumer);
> 
>             m_latestEvent = null;
> 
>         }
> 
>  
> 
> Is this expected behaviour? What if I want to subscribe to autodelete
> queue using Subscribtion class and specifying the name of the queue?
> 
>  
> 
> Best regards
> 
> Andrius Norkaitis
> 
> 
> 
> _______________________________________________
> 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