Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
When failing to parse a bulk message, we ack the delivery tag twice, c…
Browse files Browse the repository at this point in the history
…loses #9.
  • Loading branch information
kimchy committed Apr 11, 2012
1 parent 548ddc9 commit 0eb8960
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -238,15 +238,15 @@ public void run() {
while ((task = consumer.nextDelivery(bulkTimeout.millis())) != null) {
try {
bulkRequestBuilder.add(task.getBody(), 0, task.getBody().length, false);
deliveryTags.add(task.getEnvelope().getDeliveryTag());
} catch (Exception e) {
logger.warn("failed to parse request for delivery tag [{}], ack'ing...", e, task.getEnvelope().getDeliveryTag());
try {
channel.basicAck(task.getEnvelope().getDeliveryTag(), false);
} catch (IOException e1) {
} catch (Exception e1) {
logger.warn("failed to ack on failure [{}]", e1, task.getEnvelope().getDeliveryTag());
}
}
deliveryTags.add(task.getEnvelope().getDeliveryTag());
if (bulkRequestBuilder.numberOfActions() >= bulkSize) {
break;
}
Expand All @@ -272,7 +272,7 @@ public void run() {
for (Long deliveryTag : deliveryTags) {
try {
channel.basicAck(deliveryTag, false);
} catch (IOException e1) {
} catch (Exception e1) {
logger.warn("failed to ack [{}]", e1, deliveryTag);
}
}
Expand All @@ -290,7 +290,7 @@ public void onResponse(BulkResponse response) {
for (Long deliveryTag : deliveryTags) {
try {
channel.basicAck(deliveryTag, false);
} catch (IOException e1) {
} catch (Exception e1) {
logger.warn("failed to ack [{}]", e1, deliveryTag);
}
}
Expand Down

0 comments on commit 0eb8960

Please sign in to comment.