I see how much RabbitMQ fits my task.
Code from the example
$consumerTag = gethostname() . '_' . getmypid(); $connection = $this->getConnection(); $channel = $this->getChannel(); $channel->basic_qos(null, 1, null); $channel->queue_bind(self::QUEUE_NAME, 'exchange'); $channel->basic_consume(self::QUEUE_NAME, $consumerTag, false, true, false, false, function($msg) { echo $msg->body, "\n"; sleep(2); }); while(count($channel->callbacks)) { echo time()."\r\n"; $channel->wait(); } Is it possible to get several messages from the queue in a callback? Perhaps it is generally contrary to the ideology of RabbitMQ?