Class LastValueQueue
- java.lang.Object
-
- org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
-
- org.apache.activemq.artemis.core.server.impl.QueueImpl
-
- org.apache.activemq.artemis.core.server.impl.LastValueQueue
-
- All Implemented Interfaces:
Bindable,Queue,CriticalComponent
public class LastValueQueue extends QueueImpl
A queue that will discard messages if a newer message with the sameMessage.HDR_LAST_VALUE_NAMEproperty value. In other words it only retains the last valueThis is useful for example, for stock prices, where you're only interested in the latest value for a particular stock
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.activemq.artemis.core.server.impl.QueueImpl
QueueImpl.ConsumerHolder<T extends Consumer>
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.core.server.impl.QueueImpl
CHECK_QUEUE_SIZE_PERIOD, CRITICAL_CHECK_DEPAGE, CRITICAL_CONSUMER, CRITICAL_DELIVER, CRITICAL_PATH_ADD_HEAD, CRITICAL_PATH_ADD_TAIL, CRITICAL_PATHS, DEFAULT_FLUSH_LIMIT, DELIVERY_TIMEOUT, dispatching, dispatchStartTime, MAX_DELIVERIES_IN_LOOP, messageReferences, NUM_PRIORITIES, pageSubscription, pendingMetrics, scheduledDeliveryHandler
-
Fields inherited from interface org.apache.activemq.artemis.core.server.Queue
MAX_CONSUMERS_UNLIMITED
-
-
Constructor Summary
Constructors Constructor Description LastValueQueue(long persistenceID, SimpleString address, SimpleString name, Filter filter, PagingStore pagingStore, PageSubscription pageSubscription, SimpleString user, boolean durable, boolean temporary, boolean autoCreated, RoutingType routingType, Integer maxConsumers, Boolean exclusive, Boolean groupRebalance, Integer groupBuckets, SimpleString groupFirstKey, Integer consumersBeforeDispatch, Long delayBeforeDispatch, Boolean purgeOnNoConsumers, SimpleString lastValueKey, Boolean nonDestructive, Boolean autoDelete, Long autoDeleteDelay, Long autoDeleteMessageCount, boolean configurationManaged, ScheduledExecutorService scheduledExecutor, PostOffice postOffice, StorageManager storageManager, HierarchicalRepository<AddressSettings> addressSettingsRepository, ArtemisExecutor executor, ActiveMQServer server, QueueFactory factory)Deprecated.LastValueQueue(QueueConfiguration queueConfiguration, PagingStore pagingStore, PageSubscription pageSubscription, ScheduledExecutorService scheduledExecutor, PostOffice postOffice, StorageManager storageManager, HierarchicalRepository<AddressSettings> addressSettingsRepository, ArtemisExecutor executor, ActiveMQServer server, QueueFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledge(MessageReference ref, AckReason reason, ServerConsumer consumer)voidacknowledge(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer, boolean delivering)The parameter delivering can be sent as false in situation where the ack is coming outside of the context of delivering.voidaddHead(MessageReference ref, boolean scheduling)voidaddSorted(MessageReference ref, boolean scheduling)voidaddTail(MessageReference ref, boolean direct)booleanallowsReferenceCallback()the current queue and consumer settings will allow use of the Reference Execution and callback.booleanequals(Object obj)SimpleStringgetLastValueKey()Set<SimpleString>getLastValueKeys()longgetMessageCount()QueueConfigurationgetQueueConfiguration()inthashCode()booleanisLastValue()protected voidpruneLastValues()protected voidrefRemoved(MessageReference ref)voidreload(MessageReference newRef)-
Methods inherited from class org.apache.activemq.artemis.core.server.impl.QueueImpl
acknowledge, acknowledge, acknowledge, addConsumer, addHead, addLingerSession, addRedistributor, addRefSize, addSorted, addTail, browserIterator, cancel, cancel, cancel, cancelRedistributor, changeReferencePriority, changeReferencesPriority, checkRedelivery, close, debug, decDelivering, deleteAllReferences, deleteAllReferences, deleteMatchingReferences, deleteMatchingReferences, deleteQueue, deleteQueue, deleteReference, deliverAsync, deliverNow, deliverScheduledMessage, deliverScheduledMessages, deliverScheduledMessages, destroyPaging, durableDown, durableUp, errorProcessing, expire, expire, expireReference, expireReferences, expireReferences, flushExecutor, flushOnIntermediate, forceDelivery, getAcknowledgeAttempts, getAddress, getAutoDeleteDelay, getAutoDeleteMessageCount, getConsumerCount, getConsumerRemovedTimestamp, getConsumers, getConsumersBeforeDispatch, getConsumersRefCount, getDeadLetterAddress, getDelayBeforeDispatch, getDeliveringCount, getDeliveringMessages, getDeliveringSize, getDispatchStartTime, getDurableDeliveringCount, getDurableDeliveringSize, getDurableMessageCount, getDurablePersistentSize, getDurableScheduledCount, getDurableScheduledSize, getExecutor, getExpiryAddress, getFilter, getGroupBuckets, getGroupCount, getGroupFirstKey, getGroups, getID, getMaxConsumers, getMessageCountForRing, getMessagesAcknowledged, getMessagesAdded, getMessagesExpired, getMessagesKilled, getMessagesReplaced, getName, getNumberOfReferences, getPageSubscription, getPagingStore, getPersistentSize, getReference, getRingSize, getRoutingName, getRoutingType, getScheduledCount, getScheduledMessages, getScheduledSize, getUniqueName, getUser, groupMap, hasMatchingConsumer, incDelivering, incrementMesssagesAdded, isAutoCreated, isAutoDelete, isConfigurationManaged, isDirectDeliver, isDispatching, isDurable, isDurableMessage, isEnabled, isExclusive, isExpirationRedundant, isGroupRebalance, isGroupRebalancePauseDispatch, isInternalQueue, isMirrorController, isNonDestructive, isPaused, isPersistedPause, isPurgeOnNoConsumers, isSwept, isTemporary, iterator, moveReference, moveReferences, moveReferences, moveReferences, moveReferencesBetweenSnFQueues, pause, pause, peekFirstMessage, postAcknowledge, postAcknowledge, reacknowledge, recheckRefCount, refAdded, refDown, referenceHandled, refUp, reloadPause, removeAddress, removeConsumer, removeLingerSession, removeMessageReference, removeReferenceWithID, removeWithSuppliedID, rerouteMessages, resetAllGroups, resetAllIterators, resetGroup, resetMessagesAcknowledged, resetMessagesAdded, resetMessagesExpired, resetMessagesKilled, resume, retryMessages, retryMessages, route, routeWithAck, scheduleIfPossible, sendMessagesToDeadLetterAddress, sendMessageToDeadLetterAddress, sendToDeadLetterAddress, setConfigurationManaged, setConsumersBeforeDispatch, setDelayBeforeDispatch, setDispatching, setEnabled, setExclusive, setFilter, setGroupBuckets, setGroupFirstKey, setGroupRebalance, setGroupRebalancePauseDispatch, setInternalQueue, setMaxConsumer, setMirrorController, setNonDestructive, setPurgeOnNoConsumers, setRingSize, setRoutingType, setSwept, setUser, toString, unproposed
-
Methods inherited from class org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
checkExpiration, getCriticalAnalyzer, measureCritical
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.utils.critical.CriticalComponent
checkExpiration, getCriticalAnalyzer, measureCritical
-
Methods inherited from interface org.apache.activemq.artemis.core.server.Queue
deleteMatchingReferences, expireReferences, forEach
-
-
-
-
Constructor Detail
-
LastValueQueue
@Deprecated public LastValueQueue(long persistenceID, SimpleString address, SimpleString name, Filter filter, PagingStore pagingStore, PageSubscription pageSubscription, SimpleString user, boolean durable, boolean temporary, boolean autoCreated, RoutingType routingType, Integer maxConsumers, Boolean exclusive, Boolean groupRebalance, Integer groupBuckets, SimpleString groupFirstKey, Integer consumersBeforeDispatch, Long delayBeforeDispatch, Boolean purgeOnNoConsumers, SimpleString lastValueKey, Boolean nonDestructive, Boolean autoDelete, Long autoDeleteDelay, Long autoDeleteMessageCount, boolean configurationManaged, ScheduledExecutorService scheduledExecutor, PostOffice postOffice, StorageManager storageManager, HierarchicalRepository<AddressSettings> addressSettingsRepository, ArtemisExecutor executor, ActiveMQServer server, QueueFactory factory)
Deprecated.
-
LastValueQueue
public LastValueQueue(QueueConfiguration queueConfiguration, PagingStore pagingStore, PageSubscription pageSubscription, ScheduledExecutorService scheduledExecutor, PostOffice postOffice, StorageManager storageManager, HierarchicalRepository<AddressSettings> addressSettingsRepository, ArtemisExecutor executor, ActiveMQServer server, QueueFactory factory)
-
-
Method Detail
-
addTail
public void addTail(MessageReference ref, boolean direct)
-
addHead
public void addHead(MessageReference ref, boolean scheduling)
-
addSorted
public void addSorted(MessageReference ref, boolean scheduling)
-
getMessageCount
public long getMessageCount()
- Specified by:
getMessageCountin interfaceQueue- Overrides:
getMessageCountin classQueueImpl
-
allowsReferenceCallback
public boolean allowsReferenceCallback()
Description copied from interface:Queuethe current queue and consumer settings will allow use of the Reference Execution and callback. This is because- Specified by:
allowsReferenceCallbackin interfaceQueue- Overrides:
allowsReferenceCallbackin classQueueImpl
-
getQueueConfiguration
public QueueConfiguration getQueueConfiguration()
- Specified by:
getQueueConfigurationin interfaceQueue- Overrides:
getQueueConfigurationin classQueueImpl
-
pruneLastValues
protected void pruneLastValues()
- Overrides:
pruneLastValuesin classQueueImpl
-
refRemoved
protected void refRemoved(MessageReference ref)
- Overrides:
refRemovedin classQueueImpl
-
acknowledge
public void acknowledge(MessageReference ref, AckReason reason, ServerConsumer consumer) throws Exception
- Specified by:
acknowledgein interfaceQueue- Overrides:
acknowledgein classQueueImpl- Throws:
Exception
-
acknowledge
public void acknowledge(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer, boolean delivering) throws Exception
Description copied from class:QueueImplThe parameter delivering can be sent as false in situation where the ack is coming outside of the context of delivering. Example: Mirror replication will call the ack here without any consumer involved. On that case no previous delivery happened, hence no information about delivering statistics should be updated.- Specified by:
acknowledgein interfaceQueue- Overrides:
acknowledgein classQueueImpl- Throws:
Exception
-
reload
public void reload(MessageReference newRef)
-
isLastValue
public boolean isLastValue()
- Specified by:
isLastValuein interfaceQueue- Overrides:
isLastValuein classQueueImpl
-
getLastValueKey
public SimpleString getLastValueKey()
- Specified by:
getLastValueKeyin interfaceQueue- Overrides:
getLastValueKeyin classQueueImpl
-
getLastValueKeys
public Set<SimpleString> getLastValueKeys()
-
-