mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-2400 - producer flow control log messages for topics
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@817639 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ab60046336
commit
d021e5b6c7
|
@ -281,8 +281,11 @@ public class Topic extends BaseDestination implements Task{
|
||||||
isFull(context, memoryUsage);
|
isFull(context, memoryUsage);
|
||||||
fastProducer(context, producerInfo);
|
fastProducer(context, producerInfo);
|
||||||
if (isProducerFlowControl() && context.isProducerFlowControl()) {
|
if (isProducerFlowControl() && context.isProducerFlowControl()) {
|
||||||
|
final String logMessage = "Usage Manager memory limit reached. Stopping producer (" + message.getProducerId() + ") to prevent flooding " +getActiveMQDestination().getQualifiedName() + "." +
|
||||||
|
" See http://activemq.apache.org/producer-flow-control.html for more info";
|
||||||
|
LOG.info(logMessage);
|
||||||
if (systemUsage.isSendFailIfNoSpace()) {
|
if (systemUsage.isSendFailIfNoSpace()) {
|
||||||
throw new javax.jms.ResourceAllocationException("Usage Manager memory limit reached");
|
throw new javax.jms.ResourceAllocationException(logMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can avoid blocking due to low usage if the producer is sending
|
// We can avoid blocking due to low usage if the producer is sending
|
||||||
|
@ -390,8 +393,13 @@ public class Topic extends BaseDestination implements Task{
|
||||||
|
|
||||||
if (topicStore != null && message.isPersistent()
|
if (topicStore != null && message.isPersistent()
|
||||||
&& !canOptimizeOutPersistence()) {
|
&& !canOptimizeOutPersistence()) {
|
||||||
if (systemUsage.isSendFailIfNoSpace() && systemUsage.getStoreUsage().isFull()) {
|
if (systemUsage.getStoreUsage().isFull()) {
|
||||||
throw new javax.jms.ResourceAllocationException("Usage Manager Store is Full");
|
final String logMessage = "Usage Manager Store is Full. Stopping producer (" + message.getProducerId() + ") to prevent flooding " + getActiveMQDestination().getQualifiedName() + "." +
|
||||||
|
" See http://activemq.apache.org/producer-flow-control.html for more info";
|
||||||
|
LOG.info(logMessage);
|
||||||
|
if (systemUsage.isSendFailIfNoSpace()) {
|
||||||
|
throw new javax.jms.ResourceAllocationException(logMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while (!systemUsage.getStoreUsage().waitForSpace(1000)) {
|
while (!systemUsage.getStoreUsage().waitForSpace(1000)) {
|
||||||
if (context.getStopping().get()) {
|
if (context.getStopping().get()) {
|
||||||
|
|
Loading…
Reference in New Issue