[ https://issues.apache.org/jira/browse/ARTEMIS-4579?focusedWorklogId=901022&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-901022 ]
ASF GitHub Bot logged work on ARTEMIS-4579: ------------------------------------------- Author: ASF GitHub Bot Created on: 22/Jan/24 19:42 Start Date: 22/Jan/24 19:42 Worklog Time Spent: 10m Work Description: clebertsuconic commented on code in PR #4752: URL: https://github.com/apache/activemq-artemis/pull/4752#discussion_r1462333062 ########## artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerImpl.java: ########## @@ -51,10 +51,13 @@ public class ScheduledDeliveryHandlerImpl implements ScheduledDeliveryHandler { // This contains RefSchedules which are delegates to the real references // just adding some information to keep it in order accordingly to the initial operations + // Do not forget to call notifyScheduledReferencesUpdated() when updating the set. Review Comment: if you apply my suggestion please remove these calls.. ########## artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScheduledDeliveryHandlerImpl.java: ########## @@ -51,10 +51,13 @@ public class ScheduledDeliveryHandlerImpl implements ScheduledDeliveryHandler { // This contains RefSchedules which are delegates to the real references // just adding some information to keep it in order accordingly to the initial operations + // Do not forget to call notifyScheduledReferencesUpdated() when updating the set. private final TreeSet<RefScheduled> scheduledReferences = new TreeSet<>(new MessageReferenceComparator()); private final QueueMessageMetrics metrics; + private MessageReference oldestMessage = null; Review Comment: remove this upon accepting my suggestion.. (and please squash the change as yours) Issue Time Tracking ------------------- Worklog Id: (was: 901022) Time Spent: 0.5h (was: 20m) > Add the *FirstMessage* API for scheduled messages > ------------------------------------------------- > > Key: ARTEMIS-4579 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4579 > Project: ActiveMQ Artemis > Issue Type: Improvement > Components: API > Affects Versions: 2.31.2 > Reporter: Jan Å mucr > Priority: Major > Fix For: 2.32.0 > > Time Spent: 0.5h > Remaining Estimate: 0h > > Alerting on issues with messages not being received properly for a period of > time is an uneasy task. We use the {{getFirstMessageAge()}} command to > trigger alerts in Zabbix, and it works as long as there are no consumers. > But this approach fails when there are consumers repeatedly failing to > receive a message. That message is getting scheduled for redelivery over and > over, and even though there still is an old message in the queue to be > reported, it's no longer visible via {{getFirstMessage*()}} API. > The goal here is to add a set of functions working with messages scheduled > for delivery: > {noformat} > getFirstScheduledMessageAsJSON() > getFirstScheduledMessageTimestamp() > getFirstScheduledMessageAge() > {noformat} > It may be not the most effective approach but it's quite a convenient one, > especially when monitoring a wide set of queues, each with its own set of > alerts. -- This message was sent by Atlassian Jira (v8.20.10#820010)