4242 * ch1.{@link Channel#queueBind queueBind}(queueName, exchangeName, queueName);
4343 *
4444 * // Create the QueueingConsumer and have it consume from the queue
45- * QueueingConsumer consumer = new {@link QueueingConsumer#QueueingConsumer(Channel) QueueingConsumer}(ch1);
45+ * QueueingConsumer consumer = new {@link QueueingConsumer#QueueingConsumer QueueingConsumer}(ch1);
4646 * ch1.{@link Channel#basicConsume basicConsume}(queueName, false, consumer);
4747 *
4848 * // Process deliveries
5454 * </pre>
5555 *
5656 *
57- * <p>For a more complete example, see LogTail in the <code> test/src/com/rabbitmq/examples</code>
57+ * <p>For a more complete example, see LogTail in the test/src/com/rabbitmq/examples
5858 * directory of the source distribution.</p>
5959 * <p/>
6060 * <b>deprecated</b> <i><code>QueueingConsumer</code> was introduced to allow
@@ -121,6 +121,7 @@ public QueueingConsumer(Channel ch, BlockingQueue<Delivery> q) {
121121 byte [] body )
122122 throws IOException
123123 {
124+ // checkShutdown();
124125 this ._queue .add (new Delivery (envelope , properties , body ));
125126 }
126127
@@ -163,6 +164,14 @@ public byte[] getBody() {
163164 }
164165 }
165166
167+ /**
168+ * Check if we are in shutdown mode and if so throw an exception.
169+ */
170+ private void checkShutdown () {
171+ if (_shutdown != null )
172+ throw Utility .fixStackTrace (_shutdown );
173+ }
174+
166175 /**
167176 * If delivery is not POISON nor null, return it.
168177 * <p/>
@@ -198,7 +207,6 @@ private Delivery handle(Delivery delivery) {
198207 * @return the next message
199208 * @throws InterruptedException if an interrupt is received while waiting
200209 * @throws ShutdownSignalException if the connection is shut down while waiting
201- * @throws ConsumerCancelledException if this consumer is cancelled while waiting
202210 */
203211 public Delivery nextDelivery ()
204212 throws InterruptedException , ShutdownSignalException , ConsumerCancelledException
@@ -212,7 +220,6 @@ public Delivery nextDelivery()
212220 * @return the next message or null if timed out
213221 * @throws InterruptedException if an interrupt is received while waiting
214222 * @throws ShutdownSignalException if the connection is shut down while waiting
215- * @throws ConsumerCancelledException if this consumer is cancelled while waiting
216223 */
217224 public Delivery nextDelivery (long timeout )
218225 throws InterruptedException , ShutdownSignalException , ConsumerCancelledException
0 commit comments