public class AdvisoryBroker extends BrokerFilter
Modifier and Type | Field and Description |
---|---|
protected ProducerId |
advisoryProducerId |
protected ConcurrentMap<org.apache.activemq.advisory.AdvisoryBroker.VirtualConsumerPair,ConsumerInfo> |
brokerConsumerDests
This is a map to track unique demand for the existence of a virtual destination so we make sure
we don't send duplicate advisories.
|
protected ConcurrentMap<ConnectionId,ConnectionInfo> |
connections |
protected Map<ConsumerId,ConsumerInfo> |
consumers |
protected ConcurrentMap<ActiveMQDestination,DestinationInfo> |
destinations |
protected ConcurrentMap<BrokerInfo,ActiveMQMessage> |
networkBridges |
protected ConcurrentMap<ProducerId,ProducerInfo> |
producers |
protected ConcurrentMap<ConsumerInfo,VirtualDestination> |
virtualDestinationConsumers
This is a map to track all consumers that exist on the virtual destination so that we can fire
an advisory later when they go away to remove the demand.
|
protected Set<VirtualDestination> |
virtualDestinations
This is a set to track all of the virtual destinations that have been added to the broker so
they can be easily referenced later.
|
next
Constructor and Description |
---|
AdvisoryBroker(Broker next) |
Modifier and Type | Method and Description |
---|---|
void |
addConnection(ConnectionContext context,
ConnectionInfo info)
A client is establishing a connection with the broker.
|
Subscription |
addConsumer(ConnectionContext context,
ConsumerInfo info)
Adds a consumer.
|
Destination |
addDestination(ConnectionContext context,
ActiveMQDestination destination,
boolean create)
Used to create a destination.
|
void |
addDestinationInfo(ConnectionContext context,
DestinationInfo info)
Add and process a DestinationInfo object
|
void |
addProducer(ConnectionContext context,
ProducerInfo info)
Adds a producer.
|
void |
fastProducer(ConnectionContext context,
ProducerInfo producerInfo,
ActiveMQDestination destination)
Called to notify a producer is too fast
|
protected void |
fireAdvisory(ConnectionContext context,
ActiveMQTopic topic,
Command command) |
protected void |
fireAdvisory(ConnectionContext context,
ActiveMQTopic topic,
Command command,
ConsumerId targetConsumerId) |
void |
fireAdvisory(ConnectionContext context,
ActiveMQTopic topic,
Command command,
ConsumerId targetConsumerId,
ActiveMQMessage advisoryMessage) |
protected void |
fireConsumerAdvisory(ConnectionContext context,
ActiveMQDestination consumerDestination,
ActiveMQTopic topic,
Command command) |
protected void |
fireConsumerAdvisory(ConnectionContext context,
ActiveMQDestination consumerDestination,
ActiveMQTopic topic,
Command command,
ConsumerId targetConsumerId) |
protected void |
fireProducerAdvisory(ConnectionContext context,
ActiveMQDestination producerDestination,
ActiveMQTopic topic,
Command command) |
protected void |
fireProducerAdvisory(ConnectionContext context,
ActiveMQDestination producerDestination,
ActiveMQTopic topic,
Command command,
ConsumerId targetConsumerId) |
Map<ConnectionId,ConnectionInfo> |
getAdvisoryConnections() |
Collection<ConsumerInfo> |
getAdvisoryConsumers() |
Map<ActiveMQDestination,DestinationInfo> |
getAdvisoryDestinations() |
Map<ProducerId,ProducerInfo> |
getAdvisoryProducers() |
ConcurrentMap<ConsumerInfo,VirtualDestination> |
getVirtualDestinationConsumers() |
void |
isFull(ConnectionContext context,
Destination destination,
Usage<?> usage)
Called when a Usage reaches a limit
|
void |
messageConsumed(ConnectionContext context,
MessageReference messageReference)
called when message is consumed
|
void |
messageDelivered(ConnectionContext context,
MessageReference messageReference)
Called when message is delivered to the broker
|
void |
messageDiscarded(ConnectionContext context,
Subscription sub,
MessageReference messageReference)
Called when a message is discarded - e.g.
|
void |
messageExpired(ConnectionContext context,
MessageReference messageReference,
Subscription subscription)
A Message has Expired
|
void |
networkBridgeStarted(BrokerInfo brokerInfo,
boolean createdByDuplex,
String remoteIp) |
void |
networkBridgeStopped(BrokerInfo brokerInfo) |
void |
nowMasterBroker()
called when the broker becomes the master in a master/slave
configuration
|
void |
removeConnection(ConnectionContext context,
ConnectionInfo info,
Throwable error)
A client is disconnecting from the broker.
|
void |
removeConsumer(ConnectionContext context,
ConsumerInfo info)
Removes a consumer.
|
void |
removeDestination(ConnectionContext context,
ActiveMQDestination destination,
long timeout)
Used to destroy a destination.
|
void |
removeDestinationInfo(ConnectionContext context,
DestinationInfo destInfo)
Remove and process a DestinationInfo object
|
void |
removeProducer(ConnectionContext context,
ProducerInfo info)
Removes a producer.
|
void |
removeSubscription(ConnectionContext context,
RemoveSubscriptionInfo info)
Deletes a durable subscription.
|
boolean |
sendToDeadLetterQueue(ConnectionContext context,
MessageReference messageReference,
Subscription subscription,
Throwable poisonCause)
A message needs to go the a DLQ
|
void |
slowConsumer(ConnectionContext context,
Destination destination,
Subscription subs)
Called when there is a slow consumer
|
void |
virtualDestinationAdded(ConnectionContext context,
VirtualDestination virtualDestination) |
void |
virtualDestinationRemoved(ConnectionContext context,
VirtualDestination virtualDestination) |
acknowledge, addBroker, addSession, beginTransaction, brokerServiceStarted, commitTransaction, forgetTransaction, gc, getAdaptor, getAdminConnectionContext, getBrokerId, getBrokerName, getBrokerSequenceId, getBrokerService, getClients, getDestinationMap, getDestinationMap, getDestinations, getDestinations, getDurableDestinations, getExecutor, getNext, getPeerBrokerInfos, getPreparedTransactions, getRoot, getScheduler, getTempDataStore, getVmConnectorURI, isExpired, isFaultTolerantConfiguration, isStopped, messagePull, postProcessDispatch, prepareTransaction, preProcessDispatch, processConsumerControl, processDispatchNotification, reapplyInterceptor, removeBroker, removeSession, rollbackTransaction, send, setAdminConnectionContext, start, stop
protected final ConcurrentMap<ConnectionId,ConnectionInfo> connections
protected final Map<ConsumerId,ConsumerInfo> consumers
protected final Set<VirtualDestination> virtualDestinations
protected final ConcurrentMap<ConsumerInfo,VirtualDestination> virtualDestinationConsumers
protected final ConcurrentMap<org.apache.activemq.advisory.AdvisoryBroker.VirtualConsumerPair,ConsumerInfo> brokerConsumerDests
protected final ConcurrentMap<ProducerId,ProducerInfo> producers
protected final ConcurrentMap<ActiveMQDestination,DestinationInfo> destinations
protected final ConcurrentMap<BrokerInfo,ActiveMQMessage> networkBridges
protected final ProducerId advisoryProducerId
public AdvisoryBroker(Broker next)
public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception
Broker
addConnection
in interface Broker
addConnection
in class BrokerFilter
Exception
- TODOpublic Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Region
addConsumer
in interface Region
addConsumer
in class BrokerFilter
context
- the environment the operation is being executed under.Exception
- TODOpublic void addProducer(ConnectionContext context, ProducerInfo info) throws Exception
Broker
addProducer
in interface Broker
addProducer
in interface Region
addProducer
in class BrokerFilter
context
- the environment the operation is being executed under.Exception
- TODOpublic Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean create) throws Exception
Region
addDestination
in interface Region
addDestination
in class BrokerFilter
destination
- the destination to create.Exception
- TODOpublic void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception
Broker
addDestinationInfo
in interface Broker
addDestinationInfo
in class BrokerFilter
Exception
public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception
Region
removeDestination
in interface Region
removeDestination
in class BrokerFilter
context
- the environment the operation is being executed under.destination
- what is being removed from the broker.timeout
- the max amount of time to wait for the destination to quiesceException
- TODOpublic void removeDestinationInfo(ConnectionContext context, DestinationInfo destInfo) throws Exception
Broker
removeDestinationInfo
in interface Broker
removeDestinationInfo
in class BrokerFilter
Exception
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error) throws Exception
Broker
removeConnection
in interface Broker
removeConnection
in class BrokerFilter
context
- the environment the operation is being executed under.error
- null if the client requested the disconnect or the error
that caused the client to disconnect.Exception
- TODOpublic void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception
Region
removeConsumer
in interface Region
removeConsumer
in class BrokerFilter
context
- the environment the operation is being executed under.Exception
- TODOpublic void removeSubscription(ConnectionContext context, RemoveSubscriptionInfo info) throws Exception
Region
removeSubscription
in interface Region
removeSubscription
in class BrokerFilter
context
- the environment the operation is being executed under.info
- TODOException
- TODOpublic void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception
Broker
removeProducer
in interface Broker
removeProducer
in interface Region
removeProducer
in class BrokerFilter
context
- the environment the operation is being executed under.Exception
- TODOpublic void messageExpired(ConnectionContext context, MessageReference messageReference, Subscription subscription)
Broker
messageExpired
in interface Broker
messageExpired
in class BrokerFilter
subscription
- (may be null)public void messageConsumed(ConnectionContext context, MessageReference messageReference)
Broker
messageConsumed
in interface Broker
messageConsumed
in class BrokerFilter
public void messageDelivered(ConnectionContext context, MessageReference messageReference)
Broker
messageDelivered
in interface Broker
messageDelivered
in class BrokerFilter
public void messageDiscarded(ConnectionContext context, Subscription sub, MessageReference messageReference)
Broker
messageDiscarded
in interface Broker
messageDiscarded
in class BrokerFilter
public void slowConsumer(ConnectionContext context, Destination destination, Subscription subs)
Broker
slowConsumer
in interface Broker
slowConsumer
in class BrokerFilter
public void fastProducer(ConnectionContext context, ProducerInfo producerInfo, ActiveMQDestination destination)
Broker
fastProducer
in interface Broker
fastProducer
in class BrokerFilter
public void virtualDestinationAdded(ConnectionContext context, VirtualDestination virtualDestination)
virtualDestinationAdded
in interface Broker
virtualDestinationAdded
in class BrokerFilter
public void virtualDestinationRemoved(ConnectionContext context, VirtualDestination virtualDestination)
virtualDestinationRemoved
in interface Broker
virtualDestinationRemoved
in class BrokerFilter
public void isFull(ConnectionContext context, Destination destination, Usage<?> usage)
Broker
isFull
in interface Broker
isFull
in class BrokerFilter
public void nowMasterBroker()
Broker
nowMasterBroker
in interface Broker
nowMasterBroker
in class BrokerFilter
public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference, Subscription subscription, Throwable poisonCause)
Broker
sendToDeadLetterQueue
in interface Broker
sendToDeadLetterQueue
in class BrokerFilter
poisonCause
- reason for dlq submission, may be nullpublic void networkBridgeStarted(BrokerInfo brokerInfo, boolean createdByDuplex, String remoteIp)
networkBridgeStarted
in interface Broker
networkBridgeStarted
in class BrokerFilter
public void networkBridgeStopped(BrokerInfo brokerInfo)
networkBridgeStopped
in interface Broker
networkBridgeStopped
in class BrokerFilter
protected void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command) throws Exception
Exception
protected void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception
Exception
protected void fireConsumerAdvisory(ConnectionContext context, ActiveMQDestination consumerDestination, ActiveMQTopic topic, Command command) throws Exception
Exception
protected void fireConsumerAdvisory(ConnectionContext context, ActiveMQDestination consumerDestination, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception
Exception
protected void fireProducerAdvisory(ConnectionContext context, ActiveMQDestination producerDestination, ActiveMQTopic topic, Command command) throws Exception
Exception
protected void fireProducerAdvisory(ConnectionContext context, ActiveMQDestination producerDestination, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId) throws Exception
Exception
public void fireAdvisory(ConnectionContext context, ActiveMQTopic topic, Command command, ConsumerId targetConsumerId, ActiveMQMessage advisoryMessage) throws Exception
Exception
public Map<ConnectionId,ConnectionInfo> getAdvisoryConnections()
public Collection<ConsumerInfo> getAdvisoryConsumers()
public Map<ProducerId,ProducerInfo> getAdvisoryProducers()
public Map<ActiveMQDestination,DestinationInfo> getAdvisoryDestinations()
public ConcurrentMap<ConsumerInfo,VirtualDestination> getVirtualDestinationConsumers()
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.