Replace deprecated php-amqplib API
As of php-amqplib version 2.12.0 (see PR: https://github.com/php-amqplib/php-amqplib/pull/799) we should use method `ack()` on the message directly. Asked by @michaelklishin in https://github.com/rabbitmq/rabbitmq-website/pull/1113
This commit is contained in:
parent
e8ad99adc4
commit
1851d779f7
@ -1,5 +1,5 @@
|
||||
{
|
||||
"require": {
|
||||
"php-amqplib/php-amqplib": ">=v2.8.2-rc3"
|
||||
"php-amqplib/php-amqplib": ">=v2.12.1"
|
||||
}
|
||||
}
|
||||
|
@ -35,9 +35,7 @@ $callback = function ($req) {
|
||||
'',
|
||||
$req->get('reply_to')
|
||||
);
|
||||
$req->delivery_info['channel']->basic_ack(
|
||||
$req->delivery_info['delivery_tag']
|
||||
);
|
||||
$req->ack();
|
||||
};
|
||||
|
||||
$channel->basic_qos(null, 1, null);
|
||||
|
@ -14,7 +14,7 @@ $callback = function ($msg) {
|
||||
echo ' [x] Received ', $msg->body, "\n";
|
||||
sleep(substr_count($msg->body, '.'));
|
||||
echo " [x] Done\n";
|
||||
$msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);
|
||||
$msg->ack();
|
||||
};
|
||||
|
||||
$channel->basic_qos(null, 1, null);
|
||||
|
Loading…
Reference in New Issue
Block a user