<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><div>#!/usr/bin/env python</div><div>import pika</div><div>import sys</div><div>import psutil</div>
<div>import json</div><div>import time</div><div><br></div><div>serverName = &quot;salmazov&quot;</div><div>connection = pika.AsyncoreConnection(pika.ConnectionParameters(host=&#39;192.168.0.25&#39;))</div><div>channel = connection.channel()</div>
<div><br></div><div>channel.exchange_declare(exchange=&#39;cmd&#39;, type=&#39;topic&#39;)</div><div><br></div><div>cmd_data_queue = channel.queue_declare(exclusive=True).queue</div><div><br></div><div>channel.queue_bind(exchange=&#39;cmd&#39;, queue=cmd_data_queue, routing_key=&#39;cmd.*&#39;)</div>
<div><br></div><div>def callback(ch, method, properties, body):</div><div>� � print &quot; [x] %r:%r&quot; % (method.routing_key, body,)</div><div>� � procCmd = decodeddict[&quot;ProcCmd&quot;]</div><div>� � proc = psutil.Popen(procCmd)</div>
<div>� ��</div><div>channel.basic_consume(callback, queue=cmd_data_queue, no_ack=True)</div><div>pika.asyncore_loop()</div><div>--------------------------------------------</div><div><br></div><div>When I start this code -&gt; have an error:�<b>error: uncaptured python exception, closing channel &lt;pika.asyncore_adapter.RabbitDispatcher connected at 0x12ad6c0&gt;</b></div>
<div><b><br></b></div><div>I need to run processes that arrived via RmQ</div></span>