Hi David,<div><br></div><div>I have changed the code</div><div><br></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #1c39f6">import<span style="color: #000000"> </span><span style="text-decoration: underline ; color: #000000">pika</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #1c39f6">import<span style="color: #000000"> </span><span style="text-decoration: underline ; color: #000000">sys</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span style="color: #1c39f6">import</span> <span style="text-decoration: underline">pickle</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #1c39f6">import<span style="color: #000000"> json</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco">connection = pika.AsyncoreConnection(pika.ConnectionParameters(</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"> host=<span style="color: #00b435">'127.0.0.1'</span>,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"> credentials=pika.PlainCredentials(<span style="color: #00b435">'guest'</span>, <span style="color: #00b435">'guest'</span>)))</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco">channel = connection.channel()</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco">channel.queue_declare(queue=<span style="color: #00b435">'feeds'</span>, durable=<span style="color: #1c39f6">True</span>)</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #00b435"><span style="color: #000000">message = json.dumps({</span>"import_feed"<span style="color: #000000">: </span>"<a href="http://cnn.com/rss/edition.rss">http://cnn.com/rss/edition.rss</a>"<span style="color: #000000">})</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco">channel.basic_publish(exchange=<span style="color: #00b435">'feeds'</span>, routing_key=<span style="color: #00b435">'feeds'</span>,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"> body=message,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"> properties=pika.BasicProperties(</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"> delivery_mode = <span style="color: #980d08">2</span>, <span style="color: #cbcbcb"># make message persistent</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"> ))</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #00b435"><span style="color: #1c39f6">print</span><span style="color: #000000"> </span>" [x] Sent %r"<span style="color: #000000"> % (message,)</span></p>
</div><div><br></div><div>Both exchange and queue are named: feeds. Queue "feeds" does exist as I check with "rabbitmqctl list_queues"</div><div><br></div><div>However it does not work</div><div><br></div>
<div><div>Dinh-Phams-MacBook-Pro:~ dinhpham$ sudo /Users/dinhpham/dev/rabbitmq_server-2.2.0/sbin/rabbitmqctl list_queues name messages_ready messages_unacknowledged</div><div>Listing queues ...</div><div>feed2<span class="Apple-tab-span" style="white-space:pre">        </span>0<span class="Apple-tab-span" style="white-space:pre">        </span>0</div>
<div>feeds<span class="Apple-tab-span" style="white-space:pre">        </span>0<span class="Apple-tab-span" style="white-space:pre">        </span>0</div><div>...done.</div><div><br></div><div>Still, no message is stored. Nothing special found in the log file.</div>
<div><br></div><div>Is there any special case I need to take into consideration?</div><div><br></div><div>Thanks,</div><div><br></div><div>Dinh</div><br><div class="gmail_quote">On Tue, Dec 14, 2010 at 3:55 PM, David Wragg <span dir="ltr"><<a href="mailto:david@rabbitmq.com">david@rabbitmq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<div class="im"><br>
Dinh <<a href="mailto:pcdinh@gmail.com">pcdinh@gmail.com</a>> writes:<br>
> I got a strange situation with RabbitMQ 2.1.1, Mac OSX 10.6.5, erlang<br>
> version : 5.8.1.1 (not sure if it is a bug): I was unable to store message<br>
> into queue using Python clients.In fact, it is standard code I took from<br>
> RabbitMQ site. So it is supposed to work. It already worked before. For me,<br>
> yes.<br>
><br>
</div>> [...]<br>
<div class="im">> channel.queue_declare(queue='feeds', durable=True)<br>
</div>> [...]<br>
<div class="im">> channel.basic_publish(exchange='', routing_key='importer',<br>
</div>> [...]<br>
<br>
In the code you provide, you declare a queue called 'feeds', but you are<br>
trying to publish to a queue called 'importer'. If no such queue<br>
exists, these published messages will simply be discarded.<br>
<br>
David<br>
<font color="#888888"><br>
--<br>
David Wragg<br>
Staff Engineer, RabbitMQ<br>
SpringSource, a division of VMware<br>
</font></blockquote></div><br><br>
</div>