Database Reference
In-Depth Information
log.warn("AMQP connection dropped, will attempt to
reconnect...");
Utils.sleep(WAIT_AFTER_SHUTDOWN_SIGNAL);
reconnect();
} catch (ConsumerCancelledException e) {
log.warn("AMQP consumer cancelled, will attempt to
reconnect...");
Utils.sleep(WAIT_AFTER_SHUTDOWN_SIGNAL);
reconnect();
} catch (InterruptedException e) {
log.error("Interrupted while reading a message,
with Exception : " +e);
}
}
}
/*
* ack method to acknowledge the message that is
successfully processed
*/
public void ack(Object msgId) {
if (msgId instanceof Long) {
final long deliveryTag = (Long) msgId;
if (amqpChannel != null) {
try {
amqpChannel.basicAck(deliveryTag, false);
} catch (IOException e) {
log.warn("Failed to ack delivery-tag " +
deliveryTag, e);
} catch (ShutdownSignalException e) {
log.warn("AMQP connection failed. Failed to ack
delivery-tag " + deliveryTag, e);
}
}
} else {
log.warn(String.format("don't know how to ack(%s:
%s)", msgId.getClass().getName(), msgId));
}
}
Search WWH ::




Custom Search