Skip to content

Commit

Permalink
use nack, not ack for unprocessable amqp messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennart Koopmann committed Apr 10, 2013
1 parent f0b20db commit 9b15de5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/graylog2/inputs/amqp/AMQPConsumer.java
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.
*
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 9b15de5

Please sign in to comment.