return $envelopes;
} private function receiveWithQueueName(AmqpReceiver
$receiver) { // let RabbitMQ receive messages
usleep(100 * 1000
); // 100ms
$receivedEnvelopes =
[];
foreach ($receiver->
get() as $envelope) { $queueName =
$envelope->
last(AmqpReceivedStamp::
class)->
getQueueName();
$receivedEnvelopes[$queueName] =
$envelope;
$receiver->
ack($envelope);
} return $receivedEnvelopes;
}}