use of com.rabbitmq.client.QueueingConsumer in project rabbitmq-java-client by rabbitmq.
the class PerConsumerPrefetch method prefetchOnEmpty.
@Test
public void prefetchOnEmpty() throws IOException {
QueueingConsumer c = new QueueingConsumer(channel);
publish(q, 5);
consume(c, 10, false);
drain(c, 5);
publish(q, 10);
drain(c, 5);
}
use of com.rabbitmq.client.QueueingConsumer in project rabbitmq-java-client by rabbitmq.
the class ExchangeExchangeBindings method exchangeRoutingLoop.
/* pre (eN --> qN) for N in [0..2]
* add binding (e1 --> e0)
* add binding (e2 --> e1)
* add binding (e0 --> e2)
* test (eN --> {q0, q1, q2}) for N in [0..2]
*/
@Test
public void exchangeRoutingLoop() throws IOException, ShutdownSignalException, InterruptedException {
channel.exchangeBind("e0", "e1", "");
channel.exchangeBind("e1", "e2", "");
channel.exchangeBind("e2", "e0", "");
for (String e : exchanges) {
publishWithMarker(e, "");
for (QueueingConsumer c : consumers) {
consumeNoDuplicates(c);
}
}
channel.exchangeUnbind("e0", "e1", "");
channel.exchangeUnbind("e1", "e2", "");
channel.exchangeUnbind("e2", "e0", "");
}
use of com.rabbitmq.client.QueueingConsumer in project rabbitmq-java-client by rabbitmq.
the class QosTests method limitedToUnlimited.
@Test
public void limitedToUnlimited() throws IOException {
QueueingConsumer c = new QueueingConsumer(channel);
configure(c, 1, 3);
channel.basicQos(0, true);
drain(c, 2);
}
use of com.rabbitmq.client.QueueingConsumer in project rabbitmq-java-client by rabbitmq.
the class QosTests method setLimitAfterConsume.
@Test
public void setLimitAfterConsume() throws IOException {
QueueingConsumer c = new QueueingConsumer(channel);
declareBindConsume(c);
channel.basicQos(1, true);
fill(3);
// We actually only guarantee that the limit takes effect
// *eventually*, so this can in fact fail. It's pretty unlikely
// though.
List<Delivery> d = drain(c, 1);
ack(d, true);
drain(c, 1);
}
use of com.rabbitmq.client.QueueingConsumer in project rabbitmq-java-client by rabbitmq.
the class QosTests method recoverReducesLimit.
@Test
public void recoverReducesLimit() throws Exception {
channel.basicQos(2, true);
QueueingConsumer c = new QueueingConsumer(channel);
declareBindConsume(c);
fill(3);
drain(c, 2);
channel.basicRecover(true);
drain(c, 2);
}
Aggregations