[rabbitmq-discuss] cannot redeclare exchange with different type

Roatin Marth roatin.marth at gmail.com
Fri Dec 20 17:01:30 GMT 2013


right, then
i wasn't actually trying to change the type when i initially posted my 
query. which is why i was confused.
based on the samples on the rabbit tutorials, i assumed the call to 
declare_exchange was idempotent, meaning if it already existed, it wouldn't 
try to recreate it.
in my example, i have an exchange "myExchange" of type fanout. my code was 
simply ensuring this exchange existed by calling 
declare_exchange("myExchange", fanout);
when i ran my code the second time, it was giving me that error as if i was 
trying to change the type.
i checked the management page and the exchange was there with type fanout.
after i deleted the exchange, the code worked as expected after subsequent 
reruns of the app.




On Wednesday, 18 December 2013 19:28:45 UTC-5, Alvaro Videla wrote:
>
> Sid, 
>
> Yes, to change queues and exchange parameters/types you need to delete 
> them and redeclare them. 
>
> Regards, 
>
> Alvaro 
>
> On Thu, Dec 19, 2013 at 1:20 AM, Sid Young <sid.... at gmail.com<javascript:>> 
> wrote: 
> > 
> > I have been exploring fanout exchanges for a few nights as part of a 
> stock 
> > graphing system I'm writing and in the process of recreating the 
> exchange 
> > numerous times via my c++ programs, it appears once created, you need to 
> > delete it before redefining it as a different type. 
> > 
> > Sid 
> > 
> > 
> > 
> > 
> > On Wednesday, December 18, 2013 8:01:18 AM UTC+10, Roatin Marth wrote: 
> >> 
> >> g'day folks, 
> >> 
> >> just been rummaging through the rabbit mq tutorials and got myself 
> stuck 
> >> in a slight rut. 
> >> 
> >> i'm perusing the pub/sub example in python on windows. 
> >> i've declared an exchange, and having run the script, I can see it's 
> been 
> >> created through the management console, 
> >> but I keep getting an exception as soon as I run either the producer or 
> >> the consumer app. 
> >> 
> >> if I comment out the exchange_declare line, all is well. 
> >> 
> >> the logger says I cannot redeclare an exchange with a different type. 
> >> in the management window I can see it is of type fanout. the code is 
> >> declaring it as fanout. 
> >> I was under the impression exchange_declare was idempotent. is this 
> >> correct? 
> > 
> > 
> > _______________________________________________ 
> > rabbitmq-discuss mailing list 
> > rabbitmq... at lists.rabbitmq.com <javascript:> 
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss 
> > 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131220/d7377d8e/attachment.html>


More information about the rabbitmq-discuss mailing list