[AMQ-6854] - periodic log warn on store limits reached in the same way

This commit is contained in:
gtully 2017-11-21 14:56:02 +00:00
parent 08aa5118ff
commit 151e17abfe
1 changed files with 10 additions and 2 deletions

View File

@ -673,12 +673,20 @@ public abstract class BaseDestination implements Destination {
protected final void waitForSpace(ConnectionContext context, ProducerBrokerExchange producerBrokerExchange, Usage<?> usage, int highWaterMark, String warning) throws IOException, InterruptedException, ResourceAllocationException {
if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) {
getLog().debug("sendFailIfNoSpace, forcing exception on send, usage: {}: {}", usage, warning);
if (isFlowControlLogRequired()) {
getLog().info("sendFailIfNoSpace, forcing exception on send, usage: {}: {}", usage, warning);
} else {
getLog().debug("sendFailIfNoSpace, forcing exception on send, usage: {}: {}", usage, warning);
}
throw new ResourceAllocationException(warning);
}
if (!context.isNetworkConnection() && systemUsage.getSendFailIfNoSpaceAfterTimeout() != 0) {
if (!usage.waitForSpace(systemUsage.getSendFailIfNoSpaceAfterTimeout(), highWaterMark)) {
getLog().debug("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: {}: {}", usage, warning);
if (isFlowControlLogRequired()) {
getLog().info("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: {}: {}", usage, warning);
} else {
getLog().debug("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: {}: {}", usage, warning);
}
throw new ResourceAllocationException(warning);
}
} else {