mirror of https://github.com/apache/activemq.git
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:
parent
472782ad8f
commit
538d07e5bb
|
@ -505,11 +505,9 @@ 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()) {
|
||||||
throw new IOException(
|
throw new IOException(
|
||||||
|
|
|
@ -399,11 +399,9 @@ 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()) {
|
||||||
throw new IOException("Connection closed, send aborted.");
|
throw new IOException("Connection closed, send aborted.");
|
||||||
|
|
Loading…
Reference in New Issue