Skip to content

Commit e1ca4d5

Browse files
corpseeramunasd
authored andcommitted
Removed using of internal property AMQPMessage::delivery_info from docs and examples.
1 parent 9cd426f commit e1ca4d5

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

demo/basic_get.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
$channel->basic_publish($toSend, $exchange);
4343

4444
$message = $channel->basic_get($queue);
45-
46-
$channel->basic_ack($message->delivery_info['delivery_tag']);
45+
$message->ack();
4746

4847
var_dump($message->body);
4948

demo/basic_qos.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
function process_message($message)
1616
{
17-
$message->delivery_info['channel']->basic_ack($message->delivery_info['delivery_tag']);
17+
$message->ack();
1818
}
1919

2020
$channel->basic_consume('qos_queue', '', false, false, false, false, 'process_message');

doc/AMQPMessage.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ Getting message properties:
3838

3939
You can acknowledge messages by sending a `basic_ack` on the channel:
4040

41-
$msg->delivery_info['channel']->
42-
basic_ack($msg->delivery_info['delivery_tag']);
41+
$msg->getChannel()->
42+
basic_ack($msg->getDeliveryTag());
43+
44+
Or by sending `ack` method on the message:
45+
46+
$msg->ack();
4347

4448
Keep in mind that the `delivery_tag` has to be valid so most of the time just use the one provide by the server.
4549

0 commit comments

Comments
 (0)