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
A queue that will discard messages if a newer message with the same
Message.HDR_LAST_VALUE_NAME property value. In other words
it only retains the last value
This 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, queueConfiguration, scheduledDeliveryHandlerFields inherited from interface org.apache.activemq.artemis.core.server.Queue
MAX_CONSUMERS_UNLIMITED -
Constructor Summary
ConstructorsConstructorDescriptionLastValueQueue(QueueConfiguration queueConfiguration, Filter filter, PagingStore pagingStore, PageSubscription pageSubscription, ScheduledExecutorService scheduledExecutor, PostOffice postOffice, StorageManager storageManager, HierarchicalRepository<AddressSettings> addressSettingsRepository, ArtemisExecutor executor, ActiveMQServer server, QueueFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(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) Called when a message is cancelled back into the queuevoidaddTail(MessageReference ref, boolean direct) booleanthe current queue and consumer settings will allow use of the Reference Execution and callback.booleanlonginthashCode()protected voidprotected voidvoidreload(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, copyReference, 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, getCreatedTimestamp, getDeadLetterAddress, getDelayBeforeDispatch, getDeliveringCount, getDeliveringMessages, getDeliveringSize, getDispatchStartTime, getDurableDeliveringCount, getDurableDeliveringSize, getDurableMessageCount, getDurablePersistentSize, getDurableScheduledCount, getDurableScheduledSize, getExecutor, getExpiryAddress, getFilter, getGroupBuckets, getGroupCount, getGroupFirstKey, getGroups, getID, getInitialQueueBufferSize, getLastValueKey, getMaxConsumers, getMessagesAcknowledged, getMessagesAdded, getMessagesExpired, getMessagesKilled, getMessagesReplaced, getName, getNumberOfReferences, getPageSubscription, getPagingStore, getPendingMessageCount, getPersistentSize, getQueueConfiguration, getRedistributor, getRingSize, getRoutingName, getRoutingType, getScheduledCount, getScheduledMessages, getScheduledSize, getUniqueName, getUser, groupMap, hasMatchingConsumer, incDelivering, incrementMesssagesAdded, isAutoCreated, isAutoDelete, isConfigurationManaged, isDirectDeliver, isDispatching, isDurable, isDurableMessage, isEnabled, isExclusive, isGroupRebalance, isGroupRebalancePauseDispatch, isInternalQueue, isLastValue, isMirrorController, isNonDestructive, isPaused, isPersistedPause, isPurgeOnNoConsumers, isSwept, isTemporary, iterator, moveReference, moveReferences, moveReferences, moveReferences, moveReferencesBetweenSnFQueues, pause, pause, peekFirstMessage, peekFirstScheduledMessage, postAcknowledge, postAcknowledge, reacknowledge, recheckRefCount, refAdded, refDown, referenceHandled, refUp, reloadPause, reloadSequence, 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, unproposedMethods inherited from class org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
checkExpiration, getCriticalAnalyzer, measureCriticalMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.utils.critical.CriticalComponent
checkExpiration, getCriticalAnalyzer, measureCriticalMethods inherited from interface org.apache.activemq.artemis.core.server.Queue
deleteMatchingReferences, expireReferences, forEach
-
Constructor Details
-
LastValueQueue
public LastValueQueue(QueueConfiguration queueConfiguration, Filter filter, PagingStore pagingStore, PageSubscription pageSubscription, ScheduledExecutorService scheduledExecutor, PostOffice postOffice, StorageManager storageManager, HierarchicalRepository<AddressSettings> addressSettingsRepository, ArtemisExecutor executor, ActiveMQServer server, QueueFactory factory)
-
-
Method Details
-
addTail
-
addHead
-
addSorted
Description copied from interface:QueueCalled when a message is cancelled back into the queue -
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
-
pruneLastValues
protected void pruneLastValues()- Overrides:
pruneLastValuesin classQueueImpl
-
refRemoved
- 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
-
getLastValueKeys
-
hashCode
public int hashCode() -
equals
-