title: How can I get single message from rabbitMq queue using PHP?
body: <p>I need to catch just one actual message from one queue. Rabbit tries to catch all of them. Simplified code below:</p>
  
  <pre><code>private function getSingleTask(){
  $connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');
  
  $channel = $connection-&gt;channel();
  $channel-&gt;queue_declare('hello', false, false, false, false);
  
  $callback = function($msg) {
   return $msg-&gt;body;
  };
  
  $channel-&gt;basic_qos(null, 1, null);
  $channel-&gt;basic_consume('helloQueue', '', false, true, false, false, $callback);
  $channel-&gt;wait(null, true, 5);
  }
  </code></pre>
  
  <p>I throw few messages to the queue, but once i execute part of code below, it takes ALL messages from queue and $callbacks just the first.</p>