001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.activemq.broker.region.policy;
018    
019    import org.apache.activemq.ActiveMQPrefetchPolicy;
020    import org.apache.activemq.broker.Broker;
021    import org.apache.activemq.broker.region.BaseDestination;
022    import org.apache.activemq.broker.region.Destination;
023    import org.apache.activemq.broker.region.DurableTopicSubscription;
024    import org.apache.activemq.broker.region.Queue;
025    import org.apache.activemq.broker.region.QueueBrowserSubscription;
026    import org.apache.activemq.broker.region.QueueSubscription;
027    import org.apache.activemq.broker.region.Subscription;
028    import org.apache.activemq.broker.region.Topic;
029    import org.apache.activemq.broker.region.TopicSubscription;
030    import org.apache.activemq.broker.region.cursors.PendingMessageCursor;
031    import org.apache.activemq.broker.region.group.MessageGroupHashBucketFactory;
032    import org.apache.activemq.broker.region.group.MessageGroupMapFactory;
033    import org.apache.activemq.filter.DestinationMapEntry;
034    import org.apache.activemq.network.NetworkBridgeFilterFactory;
035    import org.apache.activemq.usage.SystemUsage;
036    import org.slf4j.Logger;
037    import org.slf4j.LoggerFactory;
038    
039    /**
040     * Represents an entry in a {@link PolicyMap} for assigning policies to a
041     * specific destination or a hierarchical wildcard area of destinations.
042     * 
043     * @org.apache.xbean.XBean
044     * 
045     */
046    public class PolicyEntry extends DestinationMapEntry {
047    
048        private static final Logger LOG = LoggerFactory.getLogger(PolicyEntry.class);
049        private DispatchPolicy dispatchPolicy;
050        private SubscriptionRecoveryPolicy subscriptionRecoveryPolicy;
051        private boolean sendAdvisoryIfNoConsumers;
052        private DeadLetterStrategy deadLetterStrategy = Destination.DEFAULT_DEAD_LETTER_STRATEGY;
053        private PendingMessageLimitStrategy pendingMessageLimitStrategy;
054        private MessageEvictionStrategy messageEvictionStrategy;
055        private long memoryLimit;
056        private MessageGroupMapFactory messageGroupMapFactory;
057        private PendingQueueMessageStoragePolicy pendingQueuePolicy;
058        private PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy;
059        private PendingSubscriberMessageStoragePolicy pendingSubscriberPolicy;
060        private int maxProducersToAudit=BaseDestination.MAX_PRODUCERS_TO_AUDIT;
061        private int maxAuditDepth=BaseDestination.MAX_AUDIT_DEPTH;
062        private int maxQueueAuditDepth=BaseDestination.MAX_AUDIT_DEPTH;
063        private boolean enableAudit=true;
064        private boolean producerFlowControl = true;
065        private boolean alwaysRetroactive = false;
066        private long blockedProducerWarningInterval = Destination.DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL;
067        private boolean optimizedDispatch=false;
068        private int maxPageSize=BaseDestination.MAX_PAGE_SIZE;
069        private int maxBrowsePageSize=BaseDestination.MAX_BROWSE_PAGE_SIZE;
070        private boolean useCache=true;
071        private long minimumMessageSize=1024;
072        private boolean useConsumerPriority=true;
073        private boolean strictOrderDispatch=false;
074        private boolean lazyDispatch=false;
075        private int timeBeforeDispatchStarts = 0;
076        private int consumersBeforeDispatchStarts = 0;
077        private boolean advisoryForSlowConsumers;
078        private boolean advisoryForFastProducers;
079        private boolean advisoryForDiscardingMessages;
080        private boolean advisoryWhenFull;
081        private boolean advisoryForDelivery;
082        private boolean advisoryForConsumed;
083        private long expireMessagesPeriod = BaseDestination.EXPIRE_MESSAGE_PERIOD;
084        private int maxExpirePageSize = BaseDestination.MAX_BROWSE_PAGE_SIZE;
085        private int queuePrefetch=ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH;
086        private int queueBrowserPrefetch=ActiveMQPrefetchPolicy.DEFAULT_QUEUE_BROWSER_PREFETCH;
087        private int topicPrefetch=ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH;
088        private int durableTopicPrefetch=ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH;
089        private boolean usePrefetchExtension = true;
090        private int cursorMemoryHighWaterMark = 70;
091        private int storeUsageHighWaterMark = 100;
092        private SlowConsumerStrategy slowConsumerStrategy;
093        private boolean prioritizedMessages;
094        private boolean allConsumersExclusiveByDefault;
095        private boolean gcInactiveDestinations;
096        private boolean gcWithNetworkConsumers;
097        private long inactiveTimoutBeforeGC = BaseDestination.DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC;
098        private boolean reduceMemoryFootprint;
099        private NetworkBridgeFilterFactory networkBridgeFilterFactory;
100        private boolean doOptimzeMessageStorage = true;
101        /*
102         * percentage of in-flight messages above which optimize message store is disabled
103         */
104        private int optimizeMessageStoreInFlightLimit = 10;
105    
106    
107        public void configure(Broker broker,Queue queue) {
108            baseConfiguration(broker,queue);
109            if (dispatchPolicy != null) {
110                queue.setDispatchPolicy(dispatchPolicy);
111            }
112            queue.setDeadLetterStrategy(getDeadLetterStrategy());
113            queue.setMessageGroupMapFactory(getMessageGroupMapFactory());
114            if (memoryLimit > 0) {
115                queue.getMemoryUsage().setLimit(memoryLimit);
116            }
117            if (pendingQueuePolicy != null) {
118                PendingMessageCursor messages = pendingQueuePolicy.getQueuePendingMessageCursor(broker,queue);
119                queue.setMessages(messages);
120            }
121            
122            queue.setUseConsumerPriority(isUseConsumerPriority());
123            queue.setStrictOrderDispatch(isStrictOrderDispatch());
124            queue.setOptimizedDispatch(isOptimizedDispatch());
125            queue.setLazyDispatch(isLazyDispatch());
126            queue.setTimeBeforeDispatchStarts(getTimeBeforeDispatchStarts());
127            queue.setConsumersBeforeDispatchStarts(getConsumersBeforeDispatchStarts());
128            queue.setAllConsumersExclusiveByDefault(isAllConsumersExclusiveByDefault());
129        }
130    
131        public void configure(Broker broker,Topic topic) {
132            baseConfiguration(broker,topic);
133            if (dispatchPolicy != null) {
134                topic.setDispatchPolicy(dispatchPolicy);
135            }
136            topic.setDeadLetterStrategy(getDeadLetterStrategy());
137            if (subscriptionRecoveryPolicy != null) {
138                SubscriptionRecoveryPolicy srp = subscriptionRecoveryPolicy.copy();
139                srp.setBroker(broker);
140                topic.setSubscriptionRecoveryPolicy(srp);
141            }
142            if (memoryLimit > 0) {
143                topic.getMemoryUsage().setLimit(memoryLimit);
144            }
145            topic.setLazyDispatch(isLazyDispatch());
146        }
147        
148        public void baseConfiguration(Broker broker,BaseDestination destination) {
149            destination.setProducerFlowControl(isProducerFlowControl());
150            destination.setAlwaysRetroactive(isAlwaysRetroactive());
151            destination.setBlockedProducerWarningInterval(getBlockedProducerWarningInterval());
152            destination.setEnableAudit(isEnableAudit());
153            destination.setMaxAuditDepth(getMaxQueueAuditDepth());
154            destination.setMaxProducersToAudit(getMaxProducersToAudit());
155            destination.setMaxPageSize(getMaxPageSize());
156            destination.setMaxBrowsePageSize(getMaxBrowsePageSize());
157            destination.setUseCache(isUseCache());
158            destination.setMinimumMessageSize((int) getMinimumMessageSize());
159            destination.setAdvisoryForConsumed(isAdvisoryForConsumed());
160            destination.setAdvisoryForDelivery(isAdvisoryForDelivery());
161            destination.setAdvisoryForDiscardingMessages(isAdvisoryForDiscardingMessages());
162            destination.setAdvisoryForSlowConsumers(isAdvisoryForSlowConsumers());
163            destination.setAdvisoryForFastProducers(isAdvisoryForFastProducers());
164            destination.setAdvisoryWhenFull(isAdvisoryWhenFull());
165            destination.setSendAdvisoryIfNoConsumers(sendAdvisoryIfNoConsumers);
166            destination.setExpireMessagesPeriod(getExpireMessagesPeriod());
167            destination.setMaxExpirePageSize(getMaxExpirePageSize());
168            destination.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
169            destination.setStoreUsageHighWaterMark(getStoreUsageHighWaterMark());
170            SlowConsumerStrategy scs = getSlowConsumerStrategy();
171            if (scs != null) {
172                scs.setBrokerService(broker);
173            }
174            destination.setSlowConsumerStrategy(scs);
175            destination.setPrioritizedMessages(isPrioritizedMessages());
176            destination.setGcIfInactive(isGcInactiveDestinations());
177            destination.setGcWithNetworkConsumers(isGcWithNetworkConsumers());
178            destination.setInactiveTimoutBeforeGC(getInactiveTimoutBeforeGC());
179            destination.setReduceMemoryFootprint(isReduceMemoryFootprint());
180            destination.setDoOptimzeMessageStorage(isDoOptimzeMessageStorage());
181            destination.setOptimizeMessageStoreInFlightLimit(getOptimizeMessageStoreInFlightLimit());
182    
183        }
184    
185        public void configure(Broker broker, SystemUsage memoryManager, TopicSubscription subscription) {
186            configurePrefetch(subscription);
187            if (pendingMessageLimitStrategy != null) {
188                int value = pendingMessageLimitStrategy.getMaximumPendingMessageLimit(subscription);
189                int consumerLimit = subscription.getInfo().getMaximumPendingMessageLimit();
190                if (consumerLimit > 0) {
191                    if (value < 0 || consumerLimit < value) {
192                        value = consumerLimit;
193                    }
194                }
195                if (value >= 0) {
196                    if (LOG.isDebugEnabled()) {
197                        LOG.debug("Setting the maximumPendingMessages size to: " + value + " for consumer: " + subscription.getInfo().getConsumerId());
198                    }
199                    subscription.setMaximumPendingMessages(value);
200                }
201            }
202            if (messageEvictionStrategy != null) {
203                subscription.setMessageEvictionStrategy(messageEvictionStrategy);
204            }
205            if (pendingSubscriberPolicy != null) {
206                String name = subscription.getContext().getClientId() + "_" + subscription.getConsumerInfo().getConsumerId();
207                int maxBatchSize = subscription.getConsumerInfo().getPrefetchSize();
208                subscription.setMatched(pendingSubscriberPolicy.getSubscriberPendingMessageCursor(broker,name, maxBatchSize,subscription));
209            }
210            if (enableAudit) {
211                subscription.setEnableAudit(enableAudit);
212                subscription.setMaxProducersToAudit(maxProducersToAudit);
213                subscription.setMaxAuditDepth(maxAuditDepth);
214            }
215        }
216    
217        public void configure(Broker broker, SystemUsage memoryManager, DurableTopicSubscription sub) {
218            String clientId = sub.getSubscriptionKey().getClientId();
219            String subName = sub.getSubscriptionKey().getSubscriptionName();
220            sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
221            configurePrefetch(sub);
222            if (pendingDurableSubscriberPolicy != null) {
223                PendingMessageCursor cursor = pendingDurableSubscriberPolicy.getSubscriberPendingMessageCursor(broker,clientId, subName,sub.getPrefetchSize(),sub);
224                cursor.setSystemUsage(memoryManager);
225                sub.setPending(cursor);
226            }
227            int auditDepth = getMaxAuditDepth();
228            if (auditDepth == BaseDestination.MAX_AUDIT_DEPTH && this.isPrioritizedMessages()) {
229                sub.setMaxAuditDepth(auditDepth * 10);
230            } else {
231                sub.setMaxAuditDepth(auditDepth);
232            }
233            sub.setMaxProducersToAudit(getMaxProducersToAudit());
234            sub.setUsePrefetchExtension(isUsePrefetchExtension());        
235        }
236        
237        public void configure(Broker broker, SystemUsage memoryManager, QueueBrowserSubscription sub) {
238            configurePrefetch(sub);
239            sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
240            sub.setUsePrefetchExtension(isUsePrefetchExtension());
241        }
242        
243        public void configure(Broker broker, SystemUsage memoryManager, QueueSubscription sub) {
244            configurePrefetch(sub);
245            sub.setCursorMemoryHighWaterMark(getCursorMemoryHighWaterMark());
246            sub.setUsePrefetchExtension(isUsePrefetchExtension());
247        }
248    
249        public void configurePrefetch(Subscription subscription) {
250    
251            final int currentPrefetch = subscription.getConsumerInfo().getPrefetchSize();
252            if (subscription instanceof QueueBrowserSubscription) {
253                if (currentPrefetch == ActiveMQPrefetchPolicy.DEFAULT_QUEUE_BROWSER_PREFETCH) {
254                    ((QueueBrowserSubscription) subscription).setPrefetchSize(getQueueBrowserPrefetch());
255                }
256            } else if (subscription instanceof QueueSubscription) {
257                if (currentPrefetch == ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH) {
258                    ((QueueSubscription) subscription).setPrefetchSize(getQueuePrefetch());
259                }
260            } else if (subscription instanceof DurableTopicSubscription) {
261                if (currentPrefetch == ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH ||
262                        subscription.getConsumerInfo().getPrefetchSize() == ActiveMQPrefetchPolicy.DEFAULT_OPTIMIZE_DURABLE_TOPIC_PREFETCH) {
263                    ((DurableTopicSubscription)subscription).setPrefetchSize(getDurableTopicPrefetch());
264                }
265            } else if (subscription instanceof TopicSubscription) {
266                if (currentPrefetch == ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH) {
267                    ((TopicSubscription) subscription).setPrefetchSize(getTopicPrefetch());
268                }
269            }
270            if (currentPrefetch != 0 && subscription.getPrefetchSize() == 0) {
271                // tell the sub so that it can issue a pull request
272                subscription.updateConsumerPrefetch(0);
273            }
274        }
275    
276        // Properties
277        // -------------------------------------------------------------------------
278        public DispatchPolicy getDispatchPolicy() {
279            return dispatchPolicy;
280        }
281    
282        public void setDispatchPolicy(DispatchPolicy policy) {
283            this.dispatchPolicy = policy;
284        }
285    
286        public SubscriptionRecoveryPolicy getSubscriptionRecoveryPolicy() {
287            return subscriptionRecoveryPolicy;
288        }
289    
290        public void setSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy subscriptionRecoveryPolicy) {
291            this.subscriptionRecoveryPolicy = subscriptionRecoveryPolicy;
292        }
293    
294        public boolean isSendAdvisoryIfNoConsumers() {
295            return sendAdvisoryIfNoConsumers;
296        }
297    
298        /**
299         * Sends an advisory message if a non-persistent message is sent and there
300         * are no active consumers
301         */
302        public void setSendAdvisoryIfNoConsumers(boolean sendAdvisoryIfNoConsumers) {
303            this.sendAdvisoryIfNoConsumers = sendAdvisoryIfNoConsumers;
304        }
305    
306        public DeadLetterStrategy getDeadLetterStrategy() {
307            return deadLetterStrategy;
308        }
309    
310        /**
311         * Sets the policy used to determine which dead letter queue destination
312         * should be used
313         */
314        public void setDeadLetterStrategy(DeadLetterStrategy deadLetterStrategy) {
315            this.deadLetterStrategy = deadLetterStrategy;
316        }
317    
318        public PendingMessageLimitStrategy getPendingMessageLimitStrategy() {
319            return pendingMessageLimitStrategy;
320        }
321    
322        /**
323         * Sets the strategy to calculate the maximum number of messages that are
324         * allowed to be pending on consumers (in addition to their prefetch sizes).
325         * Once the limit is reached, non-durable topics can then start discarding
326         * old messages. This allows us to keep dispatching messages to slow
327         * consumers while not blocking fast consumers and discarding the messages
328         * oldest first.
329         */
330        public void setPendingMessageLimitStrategy(PendingMessageLimitStrategy pendingMessageLimitStrategy) {
331            this.pendingMessageLimitStrategy = pendingMessageLimitStrategy;
332        }
333    
334        public MessageEvictionStrategy getMessageEvictionStrategy() {
335            return messageEvictionStrategy;
336        }
337    
338        /**
339         * Sets the eviction strategy used to decide which message to evict when the
340         * slow consumer needs to discard messages
341         */
342        public void setMessageEvictionStrategy(MessageEvictionStrategy messageEvictionStrategy) {
343            this.messageEvictionStrategy = messageEvictionStrategy;
344        }
345    
346        public long getMemoryLimit() {
347            return memoryLimit;
348        }
349    
350        /**
351         * When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
352         * @org.apache.xbean.Property propertyEditor="org.apache.activemq.util.MemoryPropertyEditor"
353         */
354        public void setMemoryLimit(long memoryLimit) {
355            this.memoryLimit = memoryLimit;
356        }
357    
358        public MessageGroupMapFactory getMessageGroupMapFactory() {
359            if (messageGroupMapFactory == null) {
360                messageGroupMapFactory = new MessageGroupHashBucketFactory();
361            }
362            return messageGroupMapFactory;
363        }
364    
365        /**
366         * Sets the factory used to create new instances of {MessageGroupMap} used
367         * to implement the <a
368         * href="http://activemq.apache.org/message-groups.html">Message Groups</a>
369         * functionality.
370         */
371        public void setMessageGroupMapFactory(MessageGroupMapFactory messageGroupMapFactory) {
372            this.messageGroupMapFactory = messageGroupMapFactory;
373        }
374    
375        /**
376         * @return the pendingDurableSubscriberPolicy
377         */
378        public PendingDurableSubscriberMessageStoragePolicy getPendingDurableSubscriberPolicy() {
379            return this.pendingDurableSubscriberPolicy;
380        }
381    
382        /**
383         * @param pendingDurableSubscriberPolicy the pendingDurableSubscriberPolicy
384         *                to set
385         */
386        public void setPendingDurableSubscriberPolicy(PendingDurableSubscriberMessageStoragePolicy pendingDurableSubscriberPolicy) {
387            this.pendingDurableSubscriberPolicy = pendingDurableSubscriberPolicy;
388        }
389    
390        /**
391         * @return the pendingQueuePolicy
392         */
393        public PendingQueueMessageStoragePolicy getPendingQueuePolicy() {
394            return this.pendingQueuePolicy;
395        }
396    
397        /**
398         * @param pendingQueuePolicy the pendingQueuePolicy to set
399         */
400        public void setPendingQueuePolicy(PendingQueueMessageStoragePolicy pendingQueuePolicy) {
401            this.pendingQueuePolicy = pendingQueuePolicy;
402        }
403    
404        /**
405         * @return the pendingSubscriberPolicy
406         */
407        public PendingSubscriberMessageStoragePolicy getPendingSubscriberPolicy() {
408            return this.pendingSubscriberPolicy;
409        }
410    
411        /**
412         * @param pendingSubscriberPolicy the pendingSubscriberPolicy to set
413         */
414        public void setPendingSubscriberPolicy(PendingSubscriberMessageStoragePolicy pendingSubscriberPolicy) {
415            this.pendingSubscriberPolicy = pendingSubscriberPolicy;
416        }
417    
418        /**
419         * @return true if producer flow control enabled
420         */
421        public boolean isProducerFlowControl() {
422            return producerFlowControl;
423        }
424    
425        /**
426         * @param producerFlowControl
427         */
428        public void setProducerFlowControl(boolean producerFlowControl) {
429            this.producerFlowControl = producerFlowControl;
430        }
431    
432        /**
433         * @return true if topic is always retroactive
434         */
435        public boolean isAlwaysRetroactive() {
436            return alwaysRetroactive;
437        }
438    
439        /**
440         * @param alwaysRetroactive
441         */
442        public void setAlwaysRetroactive(boolean alwaysRetroactive) {
443            this.alwaysRetroactive = alwaysRetroactive;
444        }
445        
446        
447        /**
448         * Set's the interval at which warnings about producers being blocked by
449         * resource usage will be triggered. Values of 0 or less will disable
450         * warnings
451         * 
452         * @param blockedProducerWarningInterval the interval at which warning about
453         *            blocked producers will be triggered.
454         */
455        public void setBlockedProducerWarningInterval(long blockedProducerWarningInterval) {
456            this.blockedProducerWarningInterval = blockedProducerWarningInterval;
457        }
458    
459        /**
460         * 
461         * @return the interval at which warning about blocked producers will be
462         *         triggered.
463         */
464        public long getBlockedProducerWarningInterval() {
465            return blockedProducerWarningInterval;
466        }
467        
468        /**
469         * @return the maxProducersToAudit
470         */
471        public int getMaxProducersToAudit() {
472            return maxProducersToAudit;
473        }
474    
475        /**
476         * @param maxProducersToAudit the maxProducersToAudit to set
477         */
478        public void setMaxProducersToAudit(int maxProducersToAudit) {
479            this.maxProducersToAudit = maxProducersToAudit;
480        }
481    
482        /**
483         * @return the maxAuditDepth
484         */
485        public int getMaxAuditDepth() {
486            return maxAuditDepth;
487        }
488    
489        /**
490         * @param maxAuditDepth the maxAuditDepth to set
491         */
492        public void setMaxAuditDepth(int maxAuditDepth) {
493            this.maxAuditDepth = maxAuditDepth;
494        }
495    
496        /**
497         * @return the enableAudit
498         */
499        public boolean isEnableAudit() {
500            return enableAudit;
501        }
502    
503        /**
504         * @param enableAudit the enableAudit to set
505         */
506        public void setEnableAudit(boolean enableAudit) {
507            this.enableAudit = enableAudit;
508        }
509    
510        public int getMaxQueueAuditDepth() {
511            return maxQueueAuditDepth;
512        }
513    
514        public void setMaxQueueAuditDepth(int maxQueueAuditDepth) {
515            this.maxQueueAuditDepth = maxQueueAuditDepth;
516        }
517    
518        public boolean isOptimizedDispatch() {
519            return optimizedDispatch;
520        }
521    
522        public void setOptimizedDispatch(boolean optimizedDispatch) {
523            this.optimizedDispatch = optimizedDispatch;
524        }
525        
526        public int getMaxPageSize() {
527            return maxPageSize;
528        }
529    
530        public void setMaxPageSize(int maxPageSize) {
531            this.maxPageSize = maxPageSize;
532        } 
533        
534        public int getMaxBrowsePageSize() {
535            return maxBrowsePageSize;
536        }
537    
538        public void setMaxBrowsePageSize(int maxPageSize) {
539            this.maxBrowsePageSize = maxPageSize;
540        } 
541        
542        public boolean isUseCache() {
543            return useCache;
544        }
545    
546        public void setUseCache(boolean useCache) {
547            this.useCache = useCache;
548        }
549    
550        public long getMinimumMessageSize() {
551            return minimumMessageSize;
552        }
553    
554        public void setMinimumMessageSize(long minimumMessageSize) {
555            this.minimumMessageSize = minimumMessageSize;
556        }   
557        
558        public boolean isUseConsumerPriority() {
559            return useConsumerPriority;
560        }
561    
562        public void setUseConsumerPriority(boolean useConsumerPriority) {
563            this.useConsumerPriority = useConsumerPriority;
564        }
565    
566        public boolean isStrictOrderDispatch() {
567            return strictOrderDispatch;
568        }
569    
570        public void setStrictOrderDispatch(boolean strictOrderDispatch) {
571            this.strictOrderDispatch = strictOrderDispatch;
572        }
573    
574        public boolean isLazyDispatch() {
575            return lazyDispatch;
576        }
577    
578        public void setLazyDispatch(boolean lazyDispatch) {
579            this.lazyDispatch = lazyDispatch;
580        }
581    
582        public int getTimeBeforeDispatchStarts() {
583            return timeBeforeDispatchStarts;
584        }
585    
586        public void setTimeBeforeDispatchStarts(int timeBeforeDispatchStarts) {
587            this.timeBeforeDispatchStarts = timeBeforeDispatchStarts;
588        }
589    
590        public int getConsumersBeforeDispatchStarts() {
591            return consumersBeforeDispatchStarts;
592        }
593    
594        public void setConsumersBeforeDispatchStarts(int consumersBeforeDispatchStarts) {
595            this.consumersBeforeDispatchStarts = consumersBeforeDispatchStarts;
596        }
597    
598        /**
599         * @return the advisoryForSlowConsumers
600         */
601        public boolean isAdvisoryForSlowConsumers() {
602            return advisoryForSlowConsumers;
603        }
604    
605        /**
606         * @param advisoryForSlowConsumers the advisoryForSlowConsumers to set
607         */
608        public void setAdvisoryForSlowConsumers(boolean advisoryForSlowConsumers) {
609            this.advisoryForSlowConsumers = advisoryForSlowConsumers;
610        }
611    
612        /**
613         * @return the advisoryForDiscardingMessages
614         */
615        public boolean isAdvisoryForDiscardingMessages() {
616            return advisoryForDiscardingMessages;
617        }
618    
619        /**
620         * @param advisoryForDiscardingMessages the advisoryForDiscardingMessages to set
621         */
622        public void setAdvisoryForDiscardingMessages(
623                boolean advisoryForDiscardingMessages) {
624            this.advisoryForDiscardingMessages = advisoryForDiscardingMessages;
625        }
626    
627        /**
628         * @return the advisoryWhenFull
629         */
630        public boolean isAdvisoryWhenFull() {
631            return advisoryWhenFull;
632        }
633    
634        /**
635         * @param advisoryWhenFull the advisoryWhenFull to set
636         */
637        public void setAdvisoryWhenFull(boolean advisoryWhenFull) {
638            this.advisoryWhenFull = advisoryWhenFull;
639        }
640    
641        /**
642         * @return the advisoryForDelivery
643         */
644        public boolean isAdvisoryForDelivery() {
645            return advisoryForDelivery;
646        }
647    
648        /**
649         * @param advisoryForDelivery the advisoryForDelivery to set
650         */
651        public void setAdvisoryForDelivery(boolean advisoryForDelivery) {
652            this.advisoryForDelivery = advisoryForDelivery;
653        }
654    
655        /**
656         * @return the advisoryForConsumed
657         */
658        public boolean isAdvisoryForConsumed() {
659            return advisoryForConsumed;
660        }
661    
662        /**
663         * @param advisoryForConsumed the advisoryForConsumed to set
664         */
665        public void setAdvisoryForConsumed(boolean advisoryForConsumed) {
666            this.advisoryForConsumed = advisoryForConsumed;
667        }
668        
669        /**
670         * @return the advisdoryForFastProducers
671         */
672        public boolean isAdvisoryForFastProducers() {
673            return advisoryForFastProducers;
674        }
675    
676        /**
677         * @param advisoryForFastProducers the advisdoryForFastProducers to set
678         */
679        public void setAdvisoryForFastProducers(boolean advisoryForFastProducers) {
680            this.advisoryForFastProducers = advisoryForFastProducers;
681        }
682    
683        public void setMaxExpirePageSize(int maxExpirePageSize) {
684            this.maxExpirePageSize = maxExpirePageSize;
685        }
686        
687        public int getMaxExpirePageSize() {
688            return maxExpirePageSize;
689        }
690        
691        public void setExpireMessagesPeriod(long expireMessagesPeriod) {
692            this.expireMessagesPeriod = expireMessagesPeriod;
693        }
694        
695        public long getExpireMessagesPeriod() {
696            return expireMessagesPeriod;
697        }
698    
699        /**
700         * Get the queuePrefetch
701         * @return the queuePrefetch
702         */
703        public int getQueuePrefetch() {
704            return this.queuePrefetch;
705        }
706    
707        /**
708         * Set the queuePrefetch
709         * @param queuePrefetch the queuePrefetch to set
710         */
711        public void setQueuePrefetch(int queuePrefetch) {
712            this.queuePrefetch = queuePrefetch;
713        }
714    
715        /**
716         * Get the queueBrowserPrefetch
717         * @return the queueBrowserPrefetch
718         */
719        public int getQueueBrowserPrefetch() {
720            return this.queueBrowserPrefetch;
721        }
722    
723        /**
724         * Set the queueBrowserPrefetch
725         * @param queueBrowserPrefetch the queueBrowserPrefetch to set
726         */
727        public void setQueueBrowserPrefetch(int queueBrowserPrefetch) {
728            this.queueBrowserPrefetch = queueBrowserPrefetch;
729        }
730    
731        /**
732         * Get the topicPrefetch
733         * @return the topicPrefetch
734         */
735        public int getTopicPrefetch() {
736            return this.topicPrefetch;
737        }
738    
739        /**
740         * Set the topicPrefetch
741         * @param topicPrefetch the topicPrefetch to set
742         */
743        public void setTopicPrefetch(int topicPrefetch) {
744            this.topicPrefetch = topicPrefetch;
745        }
746    
747        /**
748         * Get the durableTopicPrefetch
749         * @return the durableTopicPrefetch
750         */
751        public int getDurableTopicPrefetch() {
752            return this.durableTopicPrefetch;
753        }
754    
755        /**
756         * Set the durableTopicPrefetch
757         * @param durableTopicPrefetch the durableTopicPrefetch to set
758         */
759        public void setDurableTopicPrefetch(int durableTopicPrefetch) {
760            this.durableTopicPrefetch = durableTopicPrefetch;
761        }
762        
763        public boolean isUsePrefetchExtension() {
764            return this.usePrefetchExtension;
765        }
766    
767        public void setUsePrefetchExtension(boolean usePrefetchExtension) {
768            this.usePrefetchExtension = usePrefetchExtension;
769        }
770        
771        public int getCursorMemoryHighWaterMark() {
772            return this.cursorMemoryHighWaterMark;
773        }
774    
775        public void setCursorMemoryHighWaterMark(int cursorMemoryHighWaterMark) {
776            this.cursorMemoryHighWaterMark = cursorMemoryHighWaterMark;
777            }
778    
779        public void setStoreUsageHighWaterMark(int storeUsageHighWaterMark) {
780            this.storeUsageHighWaterMark = storeUsageHighWaterMark;   
781        }
782    
783        public int getStoreUsageHighWaterMark() {
784            return storeUsageHighWaterMark;
785        }
786    
787        public void setSlowConsumerStrategy(SlowConsumerStrategy slowConsumerStrategy) {
788            this.slowConsumerStrategy = slowConsumerStrategy;
789        }
790        
791        public SlowConsumerStrategy getSlowConsumerStrategy() {
792            return this.slowConsumerStrategy;
793        }
794        
795        
796        public boolean isPrioritizedMessages() {
797            return this.prioritizedMessages;
798        }
799    
800        public void setPrioritizedMessages(boolean prioritizedMessages) {
801            this.prioritizedMessages = prioritizedMessages;
802        }
803    
804        public void setAllConsumersExclusiveByDefault(boolean allConsumersExclusiveByDefault) {
805            this.allConsumersExclusiveByDefault = allConsumersExclusiveByDefault;
806        }
807    
808        public boolean isAllConsumersExclusiveByDefault() {
809            return allConsumersExclusiveByDefault;
810        }
811    
812        public boolean isGcInactiveDestinations() {
813            return this.gcInactiveDestinations;
814        }
815    
816        public void setGcInactiveDestinations(boolean gcInactiveDestinations) {
817            this.gcInactiveDestinations = gcInactiveDestinations;
818        }
819    
820        public long getInactiveTimoutBeforeGC() {
821            return this.inactiveTimoutBeforeGC;
822        }
823    
824        public void setInactiveTimoutBeforeGC(long inactiveTimoutBeforeGC) {
825            this.inactiveTimoutBeforeGC = inactiveTimoutBeforeGC;
826        }
827    
828        public void setGcWithNetworkConsumers(boolean gcWithNetworkConsumers) {
829            this.gcWithNetworkConsumers = gcWithNetworkConsumers;
830        }
831    
832        public boolean isGcWithNetworkConsumers() {
833            return gcWithNetworkConsumers;
834        }
835    
836        public boolean isReduceMemoryFootprint() {
837            return reduceMemoryFootprint;
838        }
839    
840        public void setReduceMemoryFootprint(boolean reduceMemoryFootprint) {
841            this.reduceMemoryFootprint = reduceMemoryFootprint;
842        }
843    
844        public void setNetworkBridgeFilterFactory(NetworkBridgeFilterFactory networkBridgeFilterFactory) {
845            this.networkBridgeFilterFactory = networkBridgeFilterFactory;
846        }
847    
848        public NetworkBridgeFilterFactory getNetworkBridgeFilterFactory() {
849            return networkBridgeFilterFactory;
850        }
851    
852        public boolean isDoOptimzeMessageStorage() {
853            return doOptimzeMessageStorage;
854        }
855    
856        public void setDoOptimzeMessageStorage(boolean doOptimzeMessageStorage) {
857            this.doOptimzeMessageStorage = doOptimzeMessageStorage;
858        }
859    
860        public int getOptimizeMessageStoreInFlightLimit() {
861            return optimizeMessageStoreInFlightLimit;
862        }
863    
864        public void setOptimizeMessageStoreInFlightLimit(int optimizeMessageStoreInFlightLimit) {
865            this.optimizeMessageStoreInFlightLimit = optimizeMessageStoreInFlightLimit;
866        }
867    }