Skip to content

Commit 2ba6121

Browse files
author
Alexandru Scvortov
committed
added pubAck methods to API
1 parent 7c850e5 commit 2ba6121

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/com/rabbitmq/client/Channel.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.rabbitmq.client.AMQP.Queue;
3939
import com.rabbitmq.client.AMQP.Tx;
4040
import com.rabbitmq.client.AMQP.Basic;
41+
import com.rabbitmq.client.AMQP.PubAck;
4142
import com.rabbitmq.client.AMQP.Channel.FlowOk;
4243

4344
/**
@@ -584,4 +585,21 @@ Queue.DeclareOk queueDeclare(String queue, boolean durable, boolean exclusive, b
584585
* @throws java.io.IOException if an error is encountered
585586
*/
586587
Tx.RollbackOk txRollback() throws IOException;
588+
589+
/**
590+
* Enables publisher acknowledgements on this channel.
591+
* @param many determines whether the broker can acknowledge
592+
* multiple messages at the same time
593+
* @see com.rabbitmq.client.AMQP.PubAck.Select
594+
* @throws java.io.IOException if an error is encountered
595+
*/
596+
void pubAckSelect(boolean many) throws IOException;
597+
598+
/**
599+
* Disables publisher acknowledgements on this channel.
600+
* @see com.rabbitmq.client.AMQP.PubAck.Deselect
601+
* @see com.rabbitmq.client.AMQP.PubAck.DeselectOk
602+
* @throws java.io.IOException if an error is encountered
603+
*/
604+
PubAck.DeselectOk pubAckDeselect() throws IOException;
587605
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import com.rabbitmq.client.impl.AMQImpl.Exchange;
4949
import com.rabbitmq.client.impl.AMQImpl.Queue;
5050
import com.rabbitmq.client.impl.AMQImpl.Tx;
51+
import com.rabbitmq.client.impl.AMQImpl.PubAck;
5152
import com.rabbitmq.utility.Utility;
5253

5354
import java.io.IOException;
@@ -782,6 +783,20 @@ public Tx.RollbackOk txRollback()
782783
return (Tx.RollbackOk) exnWrappingRpc(new Tx.Rollback()).getMethod();
783784
}
784785

786+
/** Public API - {@inheritDoc} */
787+
public void pubAckSelect(boolean many)
788+
throws IOException
789+
{
790+
transmit(new PubAck.Select(many));
791+
}
792+
793+
/** Public API - {@inheritDoc} */
794+
public PubAck.DeselectOk pubAckDeselect()
795+
throws IOException
796+
{
797+
return (PubAck.DeselectOk) exnWrappingRpc(new PubAck.Deselect()).getMethod();
798+
}
799+
785800
/** Public API - {@inheritDoc} */
786801
public Channel.FlowOk flow(final boolean a) throws IOException {
787802
return (Channel.FlowOk) exnWrappingRpc(new Channel.Flow() {{active = a;}}).getMethod();

0 commit comments

Comments
 (0)