org.apache.activemq.partition
Class PartitionBroker
java.lang.Object
org.apache.activemq.broker.BrokerFilter
org.apache.activemq.partition.PartitionBroker
- All Implemented Interfaces:
- Broker, Region, org.apache.activemq.Service
- Direct Known Subclasses:
- ZooKeeperPartitionBroker
public class PartitionBroker
- extends BrokerFilter
A BrokerFilter which partitions client connections over a cluster of brokers.
It can use a client identifier like client id, authenticated user name, source ip
address or even destination being used by the connection to figure out which
is the best broker in the cluster that the connection should be using and then
redirects failover clients to that broker.
| Methods inherited from class org.apache.activemq.broker.BrokerFilter |
acknowledge, addBroker, addConsumer, 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, removeConsumer, removeDestination, removeDestinationInfo, removeProducer, removeSession, removeSubscription, rollbackTransaction, sendToDeadLetterQueue, setAdminConnectionContext, slowConsumer, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
protected static final org.slf4j.Logger LOG
plugin
protected final PartitionBrokerPlugin plugin
reloadConfigOnPoll
protected boolean reloadConfigOnPoll
monitors
protected final ConcurrentHashMap<org.apache.activemq.command.ConnectionId,org.apache.activemq.partition.PartitionBroker.ConnectionMonitor> monitors
PartitionBroker
public PartitionBroker(Broker broker,
PartitionBrokerPlugin plugin)
start
public void start()
throws Exception
- Specified by:
start in interface org.apache.activemq.Service- Overrides:
start in class BrokerFilter
- Throws:
Exception
onMonitorStart
protected void onMonitorStart()
onMonitorStop
protected void onMonitorStop()
runPartitionMonitor
protected void runPartitionMonitor()
monitorWait
protected void monitorWait()
throws InterruptedException
- Throws:
InterruptedException
monitorWakeup
protected void monitorWakeup()
reloadConfiguration
protected void reloadConfiguration()
throws Exception
- Throws:
Exception
checkTarget
protected void checkTarget(org.apache.activemq.partition.PartitionBroker.ConnectionMonitor monitor)
getConnectionString
protected String getConnectionString(HashSet<String> ids)
pickBestBroker
protected Target pickBestBroker(org.apache.activemq.partition.PartitionBroker.ConnectionMonitor monitor)
getTarget
protected Target getTarget(org.apache.activemq.command.ActiveMQDestination dest)
addConnection
public void addConnection(ConnectionContext context,
org.apache.activemq.command.ConnectionInfo info)
throws Exception
- Specified by:
addConnection in interface Broker- Overrides:
addConnection in class BrokerFilter
- Throws:
Exception
removeConnection
public void removeConnection(ConnectionContext context,
org.apache.activemq.command.ConnectionInfo info,
Throwable error)
throws Exception
- Specified by:
removeConnection in interface Broker- Overrides:
removeConnection in class BrokerFilter
- Throws:
Exception
send
public void send(ProducerBrokerExchange producerExchange,
org.apache.activemq.command.Message messageSend)
throws Exception
- Specified by:
send in interface Region- Overrides:
send in class BrokerFilter
- Throws:
Exception
getConfig
protected Partitioning getConfig()
Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.