Class SubQueueSelectorCacheBroker
java.lang.Object
org.apache.activemq.broker.BrokerFilter
org.apache.activemq.plugin.SubQueueSelectorCacheBroker
A plugin which allows the caching of the selector from a subscription queue.
This stops the build-up of unwanted messages, especially when consumers may
disconnect from time to time when using virtual destinations.
This is influenced by code snippets developed by Maciej Rakowicz
Refer to:
https://issues.apache.org/activemq/browse/AMQ-3004
http://mail-archives.apache.org/mod_mbox/activemq-users/201011.mbox/%3C8A013711-2613-450A-A487-379E784AF1D6@homeaway.co.uk%3E
-
Field Summary
FieldsFields inherited from class BrokerFilter
next -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddConsumer(ConnectionContext context, org.apache.activemq.command.ConsumerInfo info) Adds a consumer.booleandeleteAllSelectorsForDestination(String destinationName) booleandeleteSelectorForDestination(String destinationName, String selector) longgetSelectorsForDestination(String destinationName) booleanbooleanvoidremoveConsumer(ConnectionContext context, org.apache.activemq.command.ConsumerInfo info) Removes a consumer.voidrun()Persist the selector cache everyMAX_PERSIST_INTERVALms.voidsetIgnoreWildcardSelectors(boolean ignoreWildcardSelectors) voidsetPersistInterval(long persistInterval) voidsetSingleSelectorPerDestination(boolean singleSelectorPerDestination) voidstop()Methods inherited from class BrokerFilter
acknowledge, addBroker, addConnection, addDestination, addDestinationInfo, addProducer, addSession, beginTransaction, brokerServiceStarted, commitTransaction, fastProducer, forgetTransaction, gc, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getNext, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageDispatched, messageExpired, messageNoConsumers, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, prepareTransaction, preProcessDispatch, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeBroker, removeConnection, removeDestination, removeDestinationInfo, removeProducer, removeSession, removeSubscription, rollbackTransaction, send, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer, start, virtualDestinationAdded, virtualDestinationRemoved
-
Field Details
-
MATCH_EVERYTHING
- See Also:
-
MAX_PERSIST_INTERVAL
public static final long MAX_PERSIST_INTERVAL- See Also:
-
-
Constructor Details
-
SubQueueSelectorCacheBroker
-
-
Method Details
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Overrides:
stopin classBrokerFilter- Throws:
Exception
-
addConsumer
public Subscription addConsumer(ConnectionContext context, org.apache.activemq.command.ConsumerInfo info) throws Exception Description copied from interface:RegionAdds a consumer.- Specified by:
addConsumerin interfaceRegion- Overrides:
addConsumerin classBrokerFilter- Parameters:
context- the environment the operation is being executed under.- Returns:
- TODO
- Throws:
Exception- TODO
-
removeConsumer
public void removeConsumer(ConnectionContext context, org.apache.activemq.command.ConsumerInfo info) throws Exception Description copied from interface:RegionRemoves a consumer.- Specified by:
removeConsumerin interfaceRegion- Overrides:
removeConsumerin classBrokerFilter- Parameters:
context- the environment the operation is being executed under.- Throws:
Exception- TODO
-
run
-
isSingleSelectorPerDestination
public boolean isSingleSelectorPerDestination() -
setSingleSelectorPerDestination
public void setSingleSelectorPerDestination(boolean singleSelectorPerDestination) -
getSelectorsForDestination
-
getPersistInterval
public long getPersistInterval() -
setPersistInterval
public void setPersistInterval(long persistInterval) -
deleteSelectorForDestination
-
deleteAllSelectorsForDestination
-
isIgnoreWildcardSelectors
public boolean isIgnoreWildcardSelectors() -
setIgnoreWildcardSelectors
public void setIgnoreWildcardSelectors(boolean ignoreWildcardSelectors)
-