Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

implements basick_nack

  • Loading branch information...
commit 85ff1412152e2de8519dc75ffb741fe3adf89b9c 1 parent 3dcde8f
Alvaro Videla authored
12 PhpAmqpLib/Channel/AMQPChannel.php
View
@@ -36,6 +36,7 @@ class AMQPChannel extends AbstractChannel
"90,21" => "tx_commit_ok",
"90,31" => "tx_rollback_ok"
);
+
/**
*
* @var callable these parameters will be passed to function
@@ -452,9 +453,18 @@ public function basic_ack($delivery_tag, $multiple=false)
}
/**
+ * reject one or several received messages.
+ */
+ public function basic_nack($delivery_tag, $multiple=false, $requeue=false)
+ {
+ $args = $this->frameBuilder->basicNack($delivery_tag, $multiple, $requeue);
+ $this->send_method_frame(array(60, 120), $args);
+ }
+
+ /**
* end a queue consumer
*/
- public function basic_cancel($consumer_tag, $nowait=false)
+ public function basic_cancel($consumer_tag, $nowait=false)
{
$args = $this->frameBuilder->basicCancel($consumer_tag, $nowait);
$this->send_method_frame(array(60, 30), $args);
1  PhpAmqpLib/Channel/AbstractChannel.php
View
@@ -83,6 +83,7 @@ class AbstractChannel
"60,90" => "Channel.basic_reject",
"60,110" => "Channel.basic_recover",
"60,111" => "Channel.basic_recover_ok",
+ "60,120" => "Channel.basic_nack",
"90,10" => "Channel.tx_select",
"90,11" => "Channel.tx_select_ok",
"90,20" => "Channel.tx_commit",
11 PhpAmqpLib/Helper/Protocol/FrameBuilder.php
View
@@ -177,6 +177,17 @@ public function basicAck($delivery_tag, $multiple)
return $args;
}
+ public function basicNack($delivery_tag, $multiple, $requeue)
+ {
+ $args = new AMQPWriter();
+ $args->write_longlong($delivery_tag)
+ ->write_bit($multiple)
+ ->write_bit($requeue)
+ ;
+
+ return $args;
+ }
+
public function basicCancel($consumer_tag, $nowait)
{
$args = new AMQPWriter();

2 comments on commit 85ff141

tiger-seo

according to http://www.rabbitmq.com/amqp-0-9-1-quickref.html#basic.nack

THIS METHOD IS A RABBITMQ-SPECIFIC EXTENSION OF AMQP

Alvaro Videla

Yes

Please sign in to comment.
Something went wrong with that request. Please try again.