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">&#39;127.0.0.1&#39;</span>,</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco">        credentials=pika.PlainCredentials(<span style="color: #00b435">&#39;guest&#39;</span>, <span style="color: #00b435">&#39;guest&#39;</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">&#39;feeds&#39;</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>&quot;import_feed&quot;<span style="color: #000000">: </span>&quot;<a href="http://cnn.com/rss/edition.rss">http://cnn.com/rss/edition.rss</a>&quot;<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">&#39;feeds&#39;</span>, routing_key=<span style="color: #00b435">&#39;feeds&#39;</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>&quot; [x] Sent %r&quot;<span style="color: #000000"> % (message,)</span></p>
</div><div><br></div><div>Both exchange and queue are named: feeds. Queue &quot;feeds&quot; does exist as I check with &quot;rabbitmqctl list_queues&quot;</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">&lt;<a href="mailto:david@rabbitmq.com">david@rabbitmq.com</a>&gt;</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 &lt;<a href="mailto:pcdinh@gmail.com">pcdinh@gmail.com</a>&gt; writes:<br>
&gt; I got a strange situation with RabbitMQ 2.1.1, Mac OSX 10.6.5, erlang<br>
&gt; version : 5.8.1.1 (not sure if it is a bug): I was unable to store message<br>
&gt; into queue using Python clients.In fact, it is standard code I took from<br>
&gt; RabbitMQ site. So it is supposed to work. It already worked before. For me,<br>
&gt; yes.<br>
&gt;<br>
</div>&gt; [...]<br>
<div class="im">&gt; channel.queue_declare(queue=&#39;feeds&#39;, durable=True)<br>
</div>&gt; [...]<br>
<div class="im">&gt; channel.basic_publish(exchange=&#39;&#39;, routing_key=&#39;importer&#39;,<br>
</div>&gt; [...]<br>
<br>
In the code you provide, you declare a queue called &#39;feeds&#39;, but you are<br>
trying to publish to a queue called &#39;importer&#39;.  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>