git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@658127 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2008-05-20 07:01:42 +00:00
parent b9797bc618
commit 90c8ded771
2 changed files with 10 additions and 0 deletions

View File

@ -424,6 +424,11 @@ public class Queue extends BaseDestination implements Task {
final ConnectionContext context = producerExchange.getConnectionContext();
synchronized (sendLock) {
if (store != null && message.isPersistent()) {
if (isProducerFlowControl() && context.isProducerFlowControl() ) {
if (systemUsage.isSendFailIfNoSpace() && systemUsage.getStoreUsage().isFull()) {
throw new javax.jms.ResourceAllocationException("Usage Manager Store is Full");
}
}
while (!systemUsage.getStoreUsage().waitForSpace(1000)) {
if (context.getStopping().get()) {
throw new IOException(

View File

@ -385,6 +385,11 @@ public class Topic extends BaseDestination implements Task{
if (topicStore != null && message.isPersistent()
&& !canOptimizeOutPersistence()) {
if (isProducerFlowControl() && context.isProducerFlowControl() ) {
if (systemUsage.isSendFailIfNoSpace() && systemUsage.getStoreUsage().isFull()) {
throw new javax.jms.ResourceAllocationException("Usage Manager Store is Full");
}
}
while (!systemUsage.getStoreUsage().waitForSpace(1000)) {
if (context.getStopping().get()) {
throw new IOException("Connection closed, send aborted.");