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