mattrpav commented on code in PR #1423: URL: https://github.com/apache/activemq/pull/1423#discussion_r2075712903
########## activemq-broker/src/main/java/org/apache/activemq/broker/region/Topic.java: ########## @@ -826,14 +830,61 @@ protected void dispatch(final ConnectionContext context, Message message) throws } private final AtomicBoolean expiryTaskInProgress = new AtomicBoolean(false); - private final Runnable expireMessagesWork = new Runnable() { - @Override - public void run() { - List<Message> browsedMessages = new InsertionCountList<Message>(); - doBrowse(browsedMessages, getMaxExpirePageSize()); + private final Runnable expireMessagesWork = () -> { + try { Review Comment: How about adding a fast-exit check here if there are zero messages and/or zero offline durable subscribers? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact