Skip to content

Commit 33cad56

Browse files
author
Steve Powell
committed
Backout changeset bbfc45f00750cfa5040af26df5d414a415c4ab19
1 parent c9942b1 commit 33cad56

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/com/rabbitmq/client/QueueingConsumer.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
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
@@ -54,7 +54,7 @@
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

Comments
 (0)