Class PartitionBroker

  • All Implemented Interfaces:
    Broker, Region, 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.
    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
      • reloadConfigOnPoll

        protected boolean reloadConfigOnPoll
      • monitors

        protected final ConcurrentMap<ConnectionId,​org.apache.activemq.partition.PartitionBroker.ConnectionMonitor> monitors
    • Method Detail

      • onMonitorStart

        protected void onMonitorStart()
      • onMonitorStop

        protected void onMonitorStop()
      • runPartitionMonitor

        protected void runPartitionMonitor()
      • monitorWakeup

        protected void monitorWakeup()
      • reloadConfiguration

        protected void reloadConfiguration()
                                    throws Exception
        Throws:
        Exception
      • checkTarget

        protected void checkTarget​(org.apache.activemq.partition.PartitionBroker.ConnectionMonitor monitor)
      • pickBestBroker

        protected Target pickBestBroker​(org.apache.activemq.partition.PartitionBroker.ConnectionMonitor monitor)
      • send

        public void send​(ProducerBrokerExchange producerExchange,
                         Message messageSend)
                  throws Exception
        Description copied from interface: Region
        Send a message to the broker to using the specified destination. The destination specified in the message does not need to match the destination the message is sent to. This is handy in case the message is being sent to a dead letter destination.
        Specified by:
        send in interface Region
        Overrides:
        send in class BrokerFilter
        Parameters:
        producerExchange - the environment the operation is being executed under.
        Throws:
        Exception - TODO