-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use nack, not ack for unprocessable amqp messages
- Loading branch information
Lennart Koopmann
committed
Apr 10, 2013
1 parent
f0b20db
commit 9b15de5
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Copyright 2012 Lennart Koopmann <[email protected]> | ||
* Copyright 2012, 2013 Lennart Koopmann <[email protected]> | ||
* | ||
* This file is part of Graylog2. | ||
* | ||
|
@@ -223,8 +223,8 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp | |
channel.basicAck(envelope.getDeliveryTag(), false); | ||
handledMessages.mark(); | ||
} catch(Exception e) { | ||
// If something breaks here it is extremely likely that it won't work next time. Ack the message. | ||
channel.basicAck(envelope.getDeliveryTag(), false); | ||
// If something breaks here it is extremely likely that it won't work next time. Not-Ack the message and do not requeue. | ||
channel.basicNack(envelope.getDeliveryTag(), false, false); // YOLO | ||
LOG.error("Could not handle message from AMQP.", e); | ||
} | ||
} | ||
|