<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Hi --</div>
<div><br>
</div>
<div>I am experiencing a behavior I didn't expect--and don't understand :( In the following simplified code:</div>
<div><br>
</div>
<div>
<div>
<div> try:</div>
<div> self.out_channel.exchange_declare\</div>
<div> ( exchange=exchange</div>
<div> , type="topic"</div>
<div> , passive=False</div>
<div> , durable=True</div>
<div> , auto_delete=False</div>
<div> , nowait=True</div>
<div> )</div>
<div> msg_props = pika.BasicProperties(content_type="application/json", delivery_mode=2)</div>
<div> self.out_channel.basic_publish\</div>
<div> ( body=message</div>
<div> , exchange=exchange</div>
<div> , properties=msg_props</div>
<div> , routing_key=routing_key</div>
<div> )</div>
<div> except pika.exceptions.AMQPError:</div>
<div> self.logger.exception("Message not sent")</div>
</div>
</div>
<div><br>
</div>
<div>The exchange_declare above seems to block indefinitely; out-channel is a channel obtained from a blocking connection.</div>
<div><br>
</div>
<div><span class="Apple-style-span">Here's the context: node N1 (which contains the above code) uses </span>pika.BlockingConnection<span class="Apple-style-span"> to communicate with the broker, which is connected to two other nodes N2 and N3. Upon receiving
a message from N2 via a fanout exchange, N1 acknowledges it and then sends N2 a message over a different, topic exchange. The interaction between N1 and N3 follows an identical pattern.</span></div>
<div><span class="Apple-style-span"><br>
</span></div>
<div><span class="Apple-style-span">I noticed that when both N2 and N3 send messages to N1, the above code works as I thought it would only for one of them (say N2), while the exchange_declare hangs for the other (N3). The code works fine if I comment out the
exchange_declare call. N1 uses 2 channels, one for incoming messages (fanout exchange) and one for outgoing messages (topic exchange).</span></div>
<div><span class="Apple-style-span"><br>
</span></div>
<div><span class="Apple-style-span">I am using RabbitMQ 3.0.0 and pika 0.9.8.</span></div>
<div><span class="Apple-style-span"><br>
</span></div>
<div>Many (but not) all samples invoke exchange_declare as I did above (as it is idempotent) so I assume that I'm missing something rather than making a call I should not make. FWIW the exchange_declare for N1's other, fanout exchange never hangs.</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>-dm</div>
<div><span class="Apple-style-span"><br>
</span></div>
<div><span class="Apple-style-span"><br>
</span></div>
</body>
</html>