@Test public void validateSuccessfullConsumeWithEmptyQueue() throws Exception { Map<String, List<String>> routingMap = new HashMap<>(); routingMap.put("key1", Arrays.asList("queue1")); Map<String, String> exchangeToRoutingKeymap = new HashMap<>(); exchangeToRoutingKeymap.put("myExchange", "key1"); Connection conn = new TestConnection(exchangeToRoutingKeymap, routingMap); conn.createChannel().basicPublish("myExchange", "key1", null, "hello Joe".getBytes()); try (AMQPConsumer consumer = new AMQPConsumer(conn, "queue1", true)) { GetResponse response = consumer.consume(); assertNotNull(response); } }
public GetResponse consume() { return responseQueue.poll(); }
AMQPConsumer extends AMQPWorker { public GetResponse consume() { return responseQueue.poll(); } }
AMQPConsumer extends AMQPWorker { public GetResponse consume() { return responseQueue.poll(); } AMQPConsumer(final Connection connection, final String queueName, final boolean autoAcknowledge); }
AMQPConsumer extends AMQPWorker { public GetResponse consume() { return responseQueue.poll(); } AMQPConsumer(final Connection connection, final String queueName, final boolean autoAcknowledge); GetResponse consume(); void acknowledge(final GetResponse response); @Override void close(); @Override String toString(); }
AMQPConsumer extends AMQPWorker { public GetResponse consume() { return responseQueue.poll(); } AMQPConsumer(final Connection connection, final String queueName, final boolean autoAcknowledge); GetResponse consume(); void acknowledge(final GetResponse response); @Override void close(); @Override String toString();  }