|
11 | 11 | // The Original Code is RabbitMQ. |
12 | 12 | // |
13 | 13 | // The Initial Developer of the Original Code is GoPivotal, Inc. |
14 | | -// Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved. |
| 14 | +// Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. |
15 | 15 | // |
16 | 16 |
|
17 | 17 | package com.rabbitmq.client; |
|
26 | 26 | import com.rabbitmq.client.AMQP.Tx; |
27 | 27 | import com.rabbitmq.client.AMQP.Basic; |
28 | 28 | import com.rabbitmq.client.AMQP.Confirm; |
29 | | -import com.rabbitmq.client.AMQP.Channel.FlowOk; |
30 | 29 |
|
31 | 30 | /** |
32 | 31 | * Public API: Interface to an AMQ channel. See the <a href="http://www.amqp.org/">spec</a> for details. |
@@ -90,17 +89,11 @@ public interface Channel extends ShutdownNotifier { |
90 | 89 | void close(int closeCode, String closeMessage) throws IOException; |
91 | 90 |
|
92 | 91 | /** |
93 | | - * Set flow on the channel |
94 | | - * |
95 | | - * @param active if true, the server is asked to start sending. If false, the server is asked to stop sending. |
96 | | - * @throws IOException |
97 | | - */ |
98 | | - FlowOk flow(boolean active) throws IOException; |
99 | | - |
100 | | - /** |
101 | | - * Return the current Channel.Flow settings. |
| 92 | + * Indicates whether the server has asked this client to stop |
| 93 | + * sending content-bearing commands (such as basic.publish) by |
| 94 | + * issueing a channel.flow{active=false}. |
102 | 95 | */ |
103 | | - FlowOk getFlow(); |
| 96 | + boolean flowBlocked(); |
104 | 97 |
|
105 | 98 | /** |
106 | 99 | * Abort this channel with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code |
@@ -222,11 +215,24 @@ public interface Channel extends ShutdownNotifier { |
222 | 215 | * @param prefetchCount maximum number of messages that the server |
223 | 216 | * will deliver, 0 if unlimited |
224 | 217 | * @param global true if the settings should be applied to the |
225 | | - * entire connection rather than just the current channel |
| 218 | + * entire channel rather than each consumer |
226 | 219 | * @throws java.io.IOException if an error is encountered |
227 | 220 | */ |
228 | 221 | void basicQos(int prefetchSize, int prefetchCount, boolean global) throws IOException; |
229 | 222 |
|
| 223 | + /** |
| 224 | + * Request a specific prefetchCount "quality of service" settings |
| 225 | + * for this channel. |
| 226 | + * |
| 227 | + * @see #basicQos(int, int, boolean) |
| 228 | + * @param prefetchCount maximum number of messages that the server |
| 229 | + * will deliver, 0 if unlimited |
| 230 | + * @param global true if the settings should be applied to the |
| 231 | + * entire channel rather than each consumer |
| 232 | + * @throws java.io.IOException if an error is encountered |
| 233 | + */ |
| 234 | + void basicQos(int prefetchCount, boolean global) throws IOException; |
| 235 | + |
230 | 236 | /** |
231 | 237 | * Request a specific prefetchCount "quality of service" settings |
232 | 238 | * for this channel. |
@@ -622,6 +628,23 @@ void basicNack(long deliveryTag, boolean multiple, boolean requeue) |
622 | 628 | */ |
623 | 629 | String basicConsume(String queue, boolean autoAck, Consumer callback) throws IOException; |
624 | 630 |
|
| 631 | + /** |
| 632 | + * Start a non-nolocal, non-exclusive consumer, with |
| 633 | + * a server-generated consumerTag and specified arguments. |
| 634 | + * @param queue the name of the queue |
| 635 | + * @param autoAck true if the server should consider messages |
| 636 | + * acknowledged once delivered; false if the server should expect |
| 637 | + * explicit acknowledgements |
| 638 | + * @param arguments a set of arguments for the consume |
| 639 | + * @param callback an interface to the consumer object |
| 640 | + * @return the consumerTag generated by the server |
| 641 | + * @throws java.io.IOException if an error is encountered |
| 642 | + * @see com.rabbitmq.client.AMQP.Basic.Consume |
| 643 | + * @see com.rabbitmq.client.AMQP.Basic.ConsumeOk |
| 644 | + * @see #basicConsume(String, boolean, String, boolean, boolean, Map, Consumer) |
| 645 | + */ |
| 646 | + String basicConsume(String queue, boolean autoAck, Map<String, Object> arguments, Consumer callback) throws IOException; |
| 647 | + |
625 | 648 | /** |
626 | 649 | * Start a non-nolocal, non-exclusive consumer. |
627 | 650 | * @param queue the name of the queue |
|
0 commit comments