https://issues.apache.org/activemq/browse/AMQ-2343 - decouple sendFailIfNoSpace from producer flow control

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@800738 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2009-08-04 11:53:22 +00:00
parent 472782ad8f
commit 538d07e5bb
2 changed files with 4 additions and 8 deletions

View File

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

View File

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