Class Topic
java.lang.Object
org.apache.activemq.broker.region.BaseDestination
org.apache.activemq.broker.region.Topic
- All Implemented Interfaces:
Destination,org.apache.activemq.command.Message.MessageDestination,org.apache.activemq.Service,org.apache.activemq.thread.Task
- Direct Known Subclasses:
TempTopic
The Topic is a destination that sends a copy of a message to every active
Subscription registered.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CopyOnWriteArrayList<Subscription>protected static final org.slf4j.LoggerFields inherited from class org.apache.activemq.broker.region.BaseDestination
blockedProducerWarningInterval, broker, brokerService, cursorMemoryHighWaterMark, deadLetterStrategy, DEFAULT_INACTIVE_TIMEOUT_BEFORE_GC, destination, destinationStatistics, DUPLICATE_FROM_STORE_MSG_PREFIX, EXPIRE_MESSAGE_PERIOD, expireMessagesPeriod, lastBlockedProducerWarnTime, MAX_AUDIT_DEPTH, MAX_BROWSE_PAGE_SIZE, MAX_PAGE_SIZE, MAX_PRODUCERS_TO_AUDIT, memoryUsage, regionBroker, scheduler, started, store, storeUsageHighWaterMark, systemUsageFields inherited from interface org.apache.activemq.broker.region.Destination
DEFAULT_BLOCKED_PRODUCER_WARNING_INTERVAL, DEFAULT_DEAD_LETTER_STRATEGY -
Constructor Summary
ConstructorsConstructorDescriptionTopic(BrokerService brokerService, org.apache.activemq.command.ActiveMQDestination destination, TopicMessageStore store, DestinationStatistics parentStats, org.apache.activemq.thread.TaskRunnerFactory taskFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(ConnectionContext context, Subscription sub, org.apache.activemq.command.MessageAck ack, org.apache.activemq.broker.region.MessageReference node) voidactivate(ConnectionContext context, DurableTopicSubscription subscription) voidaddSubscription(ConnectionContext context, Subscription sub) org.apache.activemq.command.Message[]browse()voidclearPendingMessages(int pendingAdditionsCount) force a reread of the store - after transaction recovery completionvoiddeactivate(ConnectionContext context, DurableTopicSubscription sub, List<org.apache.activemq.broker.region.MessageReference> dispatched) voiddeleteSubscription(ConnectionContext context, SubscriptionKey key) protected voiddispatch(ConnectionContext context, org.apache.activemq.command.Message message) voidvoidgc()protected org.slf4j.LoggergetLog()voidinitialize the destinationprotected booleanbooleaniterate()org.apache.activemq.command.MessageloadMessage(org.apache.activemq.command.MessageId messageId) booleanvoidmessageExpired(ConnectionContext context, Subscription subs, org.apache.activemq.broker.region.MessageReference reference) Inform the Destination a message has expiredvoidrecoverRetroactiveMessages(ConnectionContext context, Subscription subscription) voidremoveSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) voidsend(ProducerBrokerExchange producerExchange, org.apache.activemq.command.Message message) voidsetDispatchPolicy(DispatchPolicy dispatchPolicy) voidsetSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy recoveryPolicy) voidstart()voidstop()toString()final voidwakeup()optionally called by a Subscriber - to inform the Destination its ready for more messagesMethods inherited from class org.apache.activemq.broker.region.BaseDestination
addProducer, canGC, convertToNonRangedAck, createConnectionContext, dispose, duplicateFromStore, fastProducer, getActiveMQDestination, getBlockedProducerWarningInterval, getCursorMemoryHighWaterMark, getDeadLetterStrategy, getDestinationSequenceId, getDestinationStatistics, getExpireMessagesPeriod, getInactiveTimeoutBeforeGC, getMaxAuditDepth, getMaxBrowsePageSize, getMaxExpirePageSize, getMaxPageSize, getMaxProducersToAudit, getMemoryUsage, getMessageInterceptorStrategy, getMessageStore, getMinimumMessageSize, getName, getOptimizeMessageStoreInFlightLimit, getSlowConsumerStrategy, getStoreUsageHighWaterMark, getSystemUsage, getTempUsage, hasRegularConsumers, isActive, isAdvancedMessageStatisticsEnabled, isAdvancedNetworkStatisticsEnabled, isAdvisoryForConsumed, isAdvisoryForDelivery, isAdvisoryForDiscardingMessages, isAdvisoryForDispatched, isAdvisoryForFastProducers, isAdvisoryForSlowConsumers, isAdvisoryWhenFull, isAlwaysRetroactive, isDisposed, isDLQ, isDoOptimzeMessageStorage, isEnableAudit, isFlowControlLogRequired, isFull, isGcIfInactive, isGcWithNetworkConsumers, isIncludeBodyForAdvisory, isLazyDispatch, isPersistJMSRedelivered, isPrioritizedMessages, isProducerFlowControl, isReduceMemoryFootprint, isSendAdvisoryIfNoConsumers, isSendDuplicateFromStoreToDLQ, isUseCache, markForGC, messageConsumed, messageDelivered, messageDiscarded, messageDispatched, onMessageWithNoConsumers, processDispatchNotification, removeProducer, setAdvancedMessageStatisticsEnabled, setAdvancedNetworkStatisticsEnabled, setAdvisoryForConsumed, setAdvisoryForDelivery, setAdvisoryForDiscardingMessages, setAdvisoryForDispatched, setAdvisoryForFastProducers, setAdvisoryForSlowConsumers, setAdvisoryWhenFull, setAlwaysRetroactive, setBlockedProducerWarningInterval, setCursorMemoryHighWaterMark, setDeadLetterStrategy, setDoOptimzeMessageStorage, setEnableAudit, setExpireMessagesPeriod, setGcIfInactive, setGcWithNetworkConsumers, setInactiveTimeoutBeforeGC, setIncludeBodyForAdvisory, setLazyDispatch, setMaxAuditDepth, setMaxBrowsePageSize, setMaxExpirePageSize, setMaxPageSize, setMaxProducersToAudit, setMemoryUsage, setMessageInterceptorStrategy, setMinimumMessageSize, setOptimizeMessageStoreInFlightLimit, setPersistJMSRedelivered, setPrioritizedMessages, setProducerFlowControl, setReduceMemoryFootprint, setSendAdvisoryIfNoConsumers, setSendDuplicateFromStoreToDLQ, setSlowConsumerStrategy, setStoreUsageHighWaterMark, setUseCache, slowConsumer, waitForSpace, waitForSpace
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
consumers
-
-
Constructor Details
-
Topic
public Topic(BrokerService brokerService, org.apache.activemq.command.ActiveMQDestination destination, TopicMessageStore store, DestinationStatistics parentStats, org.apache.activemq.thread.TaskRunnerFactory taskFactory) throws Exception - Throws:
Exception
-
-
Method Details
-
initialize
Description copied from class:BaseDestinationinitialize the destination- Overrides:
initializein classBaseDestination- Throws:
Exception
-
getConsumers
- Specified by:
getConsumersin interfaceDestination- Specified by:
getConsumersin classBaseDestination
-
lock
-
addSubscription
- Specified by:
addSubscriptionin interfaceDestination- Overrides:
addSubscriptionin classBaseDestination- Throws:
Exception
-
removeSubscription
public void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId) throws Exception - Specified by:
removeSubscriptionin interfaceDestination- Overrides:
removeSubscriptionin classBaseDestination- Throws:
Exception
-
deleteSubscription
- Throws:
Exception
-
activate
public void activate(ConnectionContext context, DurableTopicSubscription subscription) throws Exception - Throws:
Exception
-
deactivate
public void deactivate(ConnectionContext context, DurableTopicSubscription sub, List<org.apache.activemq.broker.region.MessageReference> dispatched) throws Exception - Throws:
Exception
-
recoverRetroactiveMessages
public void recoverRetroactiveMessages(ConnectionContext context, Subscription subscription) throws Exception - Throws:
Exception
-
send
public void send(ProducerBrokerExchange producerExchange, org.apache.activemq.command.Message message) throws Exception - Specified by:
sendin interfaceDestination- Throws:
Exception
-
toString
-
acknowledge
public void acknowledge(ConnectionContext context, Subscription sub, org.apache.activemq.command.MessageAck ack, org.apache.activemq.broker.region.MessageReference node) throws IOException - Specified by:
acknowledgein interfaceDestination- Throws:
IOException
-
gc
public void gc()- Specified by:
gcin interfaceDestination
-
loadMessage
public org.apache.activemq.command.Message loadMessage(org.apache.activemq.command.MessageId messageId) throws IOException - Throws:
IOException
-
start
- Specified by:
startin interfaceorg.apache.activemq.Service- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Throws:
Exception
-
browse
public org.apache.activemq.command.Message[] browse()- Specified by:
browsein interfaceDestination
-
doBrowse
-
iterate
public boolean iterate()- Specified by:
iteratein interfaceorg.apache.activemq.thread.Task
-
getDispatchPolicy
-
setDispatchPolicy
-
getSubscriptionRecoveryPolicy
-
setSubscriptionRecoveryPolicy
-
wakeup
public final void wakeup()Description copied from interface:Destinationoptionally called by a Subscriber - to inform the Destination its ready for more messages- Specified by:
wakeupin interfaceDestination
-
dispatch
protected void dispatch(ConnectionContext context, org.apache.activemq.command.Message message) throws Exception - Throws:
Exception
-
messageExpired
public void messageExpired(ConnectionContext context, Subscription subs, org.apache.activemq.broker.region.MessageReference reference) Description copied from interface:DestinationInform the Destination a message has expired- Specified by:
messageExpiredin interfaceDestination
-
getLog
protected org.slf4j.Logger getLog()- Specified by:
getLogin classBaseDestination
-
isOptimizeStorage
protected boolean isOptimizeStorage() -
clearPendingMessages
public void clearPendingMessages(int pendingAdditionsCount) force a reread of the store - after transaction recovery completion- Specified by:
clearPendingMessagesin interfaceDestination- Parameters:
pendingAdditionsCount-
-
getDurableTopicSubs
-