Skip to content

Commit 9cf0def

Browse files
merge default into bug14587
2 parents 7d69499 + 50b1099 commit 9cf0def

File tree

7 files changed

+12
-81
lines changed

7 files changed

+12
-81
lines changed

src/com/rabbitmq/client/Channel.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import com.rabbitmq.client.AMQP.Tx;
2727
import com.rabbitmq.client.AMQP.Basic;
2828
import com.rabbitmq.client.AMQP.Confirm;
29-
import com.rabbitmq.client.AMQP.Channel.FlowOk;
3029

3130
/**
3231
* 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 {
9089
void close(int closeCode, String closeMessage) throws IOException;
9190

9291
/**
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}.
10295
*/
103-
FlowOk getFlow();
96+
boolean flowBlocked();
10497

10598
/**
10699
* Abort this channel with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,13 +1061,8 @@ public Confirm.SelectOk confirmSelect()
10611061
}
10621062

10631063
/** Public API - {@inheritDoc} */
1064-
public Channel.FlowOk flow(final boolean a) throws IOException {
1065-
return (Channel.FlowOk) exnWrappingRpc(new Channel.Flow(a)).getMethod();
1066-
}
1067-
1068-
/** Public API - {@inheritDoc} */
1069-
public Channel.FlowOk getFlow() {
1070-
return new Channel.FlowOk(!_blockContent);
1064+
public boolean flowBlocked() {
1065+
return _blockContent;
10711066
}
10721067

10731068
/** Public API - {@inheritDoc} */

test/src/com/rabbitmq/client/test/functional/QosTests.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -344,43 +344,6 @@ public void testLimitInheritsUnackedCount()
344344
drain(c, 1);
345345
}
346346

347-
public void testFlow() throws IOException
348-
{
349-
QueueingConsumer c = new QueueingConsumer(channel);
350-
declareBindConsume(c);
351-
fill(1);
352-
drain(c, 1);
353-
channel.flow(false);
354-
fill(1);
355-
drain(c, 0);
356-
channel.flow(true);
357-
drain(c, 1);
358-
}
359-
360-
public void testLimitAndFlow() throws IOException
361-
{
362-
channel.basicQos(1);
363-
QueueingConsumer c = new QueueingConsumer(channel);
364-
declareBindConsume(c);
365-
channel.flow(false);
366-
fill(3);
367-
drain(c, 0);
368-
channel.flow(true);
369-
ack(drain(c, 1), false);
370-
drain(c, 1);
371-
channel.basicQos(0);
372-
drain(c, 1);
373-
}
374-
375-
public void testNoConsumers() throws Exception {
376-
String q = declareBind(channel);
377-
fill(1);
378-
channel.flow(false);
379-
QueueingConsumer c = new QueueingConsumer(channel);
380-
channel.basicConsume(q, c);
381-
drain(c, 0);
382-
}
383-
384347
public void testRecoverReducesLimit() throws Exception {
385348
channel.basicQos(2);
386349
QueueingConsumer c = new QueueingConsumer(channel);

test/src/com/rabbitmq/client/test/functional/UserIDHeader.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package com.rabbitmq.client.test.functional;
1818

1919
import com.rabbitmq.client.AMQP;
20+
import com.rabbitmq.client.AlreadyClosedException;
2021
import com.rabbitmq.client.test.BrokerTestCase;
21-
import com.rabbitmq.tools.Host;
2222

2323
import java.io.IOException;
2424

@@ -36,18 +36,8 @@ public void testInvalidUserId() {
3636
fail("Accepted publish with incorrect user ID");
3737
} catch (IOException e) {
3838
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
39-
}
40-
}
41-
42-
public void testImpersonatedUserId() throws IOException {
43-
Host.rabbitmqctl("set_user_tags guest administrator impersonator");
44-
connection = null;
45-
channel = null;
46-
setUp();
47-
try {
48-
publish(BAD);
49-
} finally {
50-
Host.rabbitmqctl("set_user_tags guest administrator");
39+
} catch (AlreadyClosedException e) {
40+
checkShutdownSignal(AMQP.PRECONDITION_FAILED, e);
5141
}
5242
}
5343

test/src/com/rabbitmq/client/test/performance/QosScaling.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ public long run() throws IOException {
129129
channel.basicQos(1);
130130
QueueingConsumer consumer = new QueueingConsumer(channel);
131131
try {
132-
channel.flow(false);
133132
publish(consume(consumer));
134-
channel.flow(true);
135133
return drain(consumer);
136134
} finally {
137135
connection.abort();

test/src/com/rabbitmq/examples/PerfTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ public static void main(String[] args) {
7070

7171
String uri = strArg(cmd, 'h', "amqp://localhost");
7272

73-
boolean exclusive = "".equals(queueName);
74-
7573
//setup
7674
PrintlnStats stats = new PrintlnStats(1000L * samplingInterval,
7775
producerCount > 0,
@@ -88,14 +86,13 @@ public static void main(String[] args) {
8886

8987
MulticastParams p = new MulticastParams();
9088
p.setAutoAck( autoAck);
91-
p.setAutoDelete( !exclusive);
89+
p.setAutoDelete( true);
9290
p.setConfirm( confirm);
9391
p.setConsumerCount( consumerCount);
9492
p.setConsumerMsgCount( consumerMsgCount);
9593
p.setConsumerTxSize( consumerTxSize);
9694
p.setExchangeName( exchangeName);
9795
p.setExchangeType( exchangeType);
98-
p.setExclusive( exclusive);
9996
p.setFlags( flags);
10097
p.setMultiAckEvery( multiAckEvery);
10198
p.setMinMsgSize( minMsgSize);

test/src/com/rabbitmq/examples/perf/MulticastParams.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public class MulticastParams {
4949

5050
private int multiAckEvery = 0;
5151
private boolean autoAck = true;
52-
private boolean exclusive = true;
5352
private boolean autoDelete = false;
5453

5554
private boolean predeclared;
@@ -131,10 +130,6 @@ public void setFlags(List<?> flags) {
131130
this.flags = flags;
132131
}
133132

134-
public void setExclusive(boolean exclusive) {
135-
this.exclusive = exclusive;
136-
}
137-
138133
public void setAutoDelete(boolean autoDelete) {
139134
this.autoDelete = autoDelete;
140135
}
@@ -187,7 +182,7 @@ public Consumer createConsumer(Connection connection, Stats stats, String id) th
187182
}
188183

189184
public boolean shouldConfigureQueue() {
190-
return consumerCount == 0 && !queueName.equals("") && !exclusive;
185+
return consumerCount == 0 && !queueName.equals("");
191186
}
192187

193188
public String configureQueue(Connection connection, String id) throws IOException {
@@ -199,7 +194,7 @@ public String configureQueue(Connection connection, String id) throws IOExceptio
199194
if (!predeclared || !queueExists(connection, queueName)) {
200195
qName = channel.queueDeclare(queueName,
201196
flags.contains("persistent"),
202-
exclusive, autoDelete,
197+
false, autoDelete,
203198
null).getQueue();
204199
}
205200
channel.queueBind(qName, exchangeName, id);

0 commit comments

Comments
 (0)