org.apache.activemq.plugin
Class SubQueueSelectorCacheBroker

java.lang.Object
  extended by org.apache.activemq.broker.BrokerFilter
      extended by org.apache.activemq.plugin.SubQueueSelectorCacheBroker
All Implemented Interfaces:
Runnable, Broker, Region, Service

public class SubQueueSelectorCacheBroker
extends BrokerFilter
implements Runnable

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

Author:
Roelof Naude roelof(dot)naude(at)gmail.com
See Also:
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
 
Fields inherited from class org.apache.activemq.broker.BrokerFilter
next
 
Constructor Summary
SubQueueSelectorCacheBroker(Broker next, File persistFile)
          Constructor
 
Method Summary
 Subscription addConsumer(ConnectionContext context, ConsumerInfo info)
          Adds a consumer.
 String getSelector(String destination)
           
 void run()
          Persist the selector cache every MAX_PERSIST_INTERVALms.
 void stop()
           
 
Methods inherited from class org.apache.activemq.broker.BrokerFilter
acknowledge, addBroker, addConnection, addDestination, addDestinationInfo, addProducer, addSession, beginTransaction, brokerServiceStarted, commitTransaction, fastProducer, forgetTransaction, gc, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isFull, isStopped, messageConsumed, messageDelivered, messageDiscarded, messageExpired, messagePull, networkBridgeStarted, networkBridgeStopped, nowMasterBroker, postProcessDispatch, prepareTransaction, preProcessDispatch, processConsumerControl, processDispatchNotification, removeBroker, removeConnection, removeConsumer, removeDestination, removeDestinationInfo, removeProducer, removeSession, removeSubscription, rollbackTransaction, send, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubQueueSelectorCacheBroker

public SubQueueSelectorCacheBroker(Broker next,
                                   File persistFile)
Constructor

Method Detail

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Overrides:
stop in class BrokerFilter
Throws:
Exception

addConsumer

public Subscription addConsumer(ConnectionContext context,
                                ConsumerInfo info)
                         throws Exception
Description copied from interface: Region
Adds a consumer.

Specified by:
addConsumer in interface Region
Overrides:
addConsumer in class BrokerFilter
Parameters:
context - the environment the operation is being executed under.
Returns:
TODO
Throws:
Exception - TODO

getSelector

public String getSelector(String destination)
Returns:
The JMS selector for the specified destination

run

public void run()
Persist the selector cache every MAX_PERSIST_INTERVALms.

Specified by:
run in interface Runnable
See Also:
Runnable.run()


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.