Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
AMQP-206 Polishing
Cleanup retry counter name; trap exception on cancel of
temporary reply queue.
  • Loading branch information
garyrussell committed Jan 29, 2012
commit 7fc5441959f5190d8a870b142efc0cdcf47d4fbf
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,23 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp
Thread.currentThread().interrupt();
}
}
@Override
public void handleCancel(String consumerTag)
throws IOException {
logger.debug("CANCELLED");
}
};
channel.basicConsume(replyTo, noAck, consumerTag, noLocal, exclusive, null, consumer);
doSend(channel, exchange, routingKey, message);
Message reply = (replyTimeout < 0) ? replyHandoff.take() : replyHandoff.poll(replyTimeout,
TimeUnit.MILLISECONDS);
channel.basicCancel(consumerTag);
try {
channel.basicCancel(consumerTag);
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("Error cancelling consumerTag " + consumerTag, e);
}
}
return reply;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ public void start() throws AmqpException {
} catch (IOException e) {
if (passiveDeclareTries > 0) {
if (logger.isWarnEnabled()) {
logger.warn("Reconnect failed; retries left=" + passiveDeclareTries, e);
logger.warn("Reconnect failed; retries left=" + (passiveDeclareTries-1), e);
try {
Thread.sleep(1000);
Thread.sleep(5000);
} catch (InterruptedException e1) {
Thread.currentThread().interrupt();
}
Expand Down