Allow the maxProducersToAudit value to be set of Queue and QueueBrowser subscriptions which can help to workaround OOM errors on QueueBrowsers when there are more than the max number of producers audited.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1489180 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-06-03 21:12:44 +00:00
parent bc4392bdde
commit 37ede54486
2 changed files with 38 additions and 30 deletions

View File

@ -834,6 +834,9 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
public void setMaxProducersToAudit(int maxProducersToAudit) {
this.maxProducersToAudit = maxProducersToAudit;
if (this.pending != null) {
this.pending.setMaxProducersToAudit(maxProducersToAudit);
}
}
public int getMaxAuditDepth() {
@ -842,6 +845,9 @@ public abstract class PrefetchSubscription extends AbstractSubscription {
public void setMaxAuditDepth(int maxAuditDepth) {
this.maxAuditDepth = maxAuditDepth;
if (this.pending != null) {
this.pending.setMaxAuditDepth(maxAuditDepth);
}
}
public boolean isUsePrefetchExtension() {

View File

@ -238,12 +238,14 @@ public class PolicyEntry extends DestinationMapEntry {
configurePrefetch(sub);
sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
sub.setUsePrefetchExtension(isUsePrefetchExtension());
sub.setMaxProducersToAudit(getMaxProducersToAudit());
}
public void configure(Broker broker, SystemUsage memoryManager, QueueSubscription sub) {
configurePrefetch(sub);
sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
sub.setUsePrefetchExtension(isUsePrefetchExtension());
sub.setMaxProducersToAudit(getMaxProducersToAudit());
}
public void configurePrefetch(Subscription subscription) {
@ -774,7 +776,7 @@ public class PolicyEntry extends DestinationMapEntry {
public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) {
this.cursorMemoryHighWaterMark = cursorMemoryHighWaterMark;
}
}
public void setStoreUsageHighWaterMark(int storeUsageHighWaterMark) {
this.storeUsageHighWaterMark = storeUsageHighWaterMark;