Skip to content

Commit a0d6763

Browse files
author
Rob Harrop
committed
Added Channel.basicNack
1 parent 945c3c2 commit a0d6763

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/com/rabbitmq/client/Channel.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,20 @@ Queue.DeclareOk queueDeclare(String queue, boolean durable, boolean exclusive, b
534534
*/
535535
void basicAck(long deliveryTag, boolean multiple) throws IOException;
536536

537+
/**
538+
* Reject one or several received messages.
539+
*
540+
* Supply the <code>deliveryTag</code> from the {@link com.rabbitmq.client.AMQP.Basic.GetOk}
541+
* or {@link com.rabbitmq.client.AMQP.Basic.GetOk} method containing the message to be rejected.
542+
* @see com.rabbitmq.client.AMQP.Basic.Nack
543+
* @param deliveryTag the tag from the received {@link com.rabbitmq.client.AMQP.Basic.GetOk} or {@link com.rabbitmq.client.AMQP.Basic.Deliver}
544+
* @param multiple true to reject all messages up to and including
545+
* the supplied delivery tag; false to reject just the supplied
546+
* delivery tag.
547+
* @throws java.io.IOException if an error is encountered
548+
*/
549+
void basicNack(long deliveryTag, boolean multiple) throws IOException;
550+
537551
/**
538552
* Reject a message. Supply the deliveryTag from the {@link com.rabbitmq.client.AMQP.Basic.GetOk}
539553
* or {@link com.rabbitmq.client.AMQP.Basic.Deliver} method

src/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,13 @@ public void basicAck(long deliveryTag, boolean multiple)
719719
transmit(new Basic.Ack(deliveryTag, multiple));
720720
}
721721

722+
/** Public API - {@inheritDoc} */
723+
public void basicNack(long deliveryTag, boolean multiple)
724+
throws IOException
725+
{
726+
transmit(new Basic.Nack(deliveryTag, multiple));
727+
}
728+
722729
/** Public API - {@inheritDoc} */
723730
public void basicReject(long deliveryTag, boolean requeue)
724731
throws IOException

0 commit comments

Comments
 (0)