title: How in RabbitMQ and PHP return task back to the queue?
body: <p>How can I return message back to the queue if processing result did not suit me. Found only information about message acknowledgments but I think that it does not suit me. I need that if as a result of processing I get the parameter RETRY message is added back to the queue. And then this worker or another one picks it up again and tries to process it.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;?php
  use PhpAmqpLib\Connection\AMQPStreamConnection;
  
  echo ' [*] Waiting for messages. To exit press CTRL+C', "\n";
  
  $connection = new AMQPStreamConnection($AMQP);
  $channel = $connection-&gt;channel();
  
  $channel-&gt;queue_declare('test', false, false, false, false);
  
  $callback = function($msg) {
      $condition = json_decode($msg-&gt;body);
  
      if (!$condition) {
          # return to the queue
      }
  };
  
  $channel-&gt;basic_consume('test', '', false, true, false, false, $callback);
  
  while(count($channel-&gt;callbacks)) {
      $channel-&gt;wait();
  }
  
  $channel-&gt;close();
  $connection-&gt;close();
  ?&gt;
  </code></pre>