papinifrancesco commented on PR #2634: URL: https://github.com/apache/activemq/pull/2634#issuecomment-6077127871
Thanks @mattrpav, agreed. This PR is now only that fix, one commit on current `main`: - `MessageStore.recover(MessageRecoveryListener, int maxReturned)`: a new default method that calls `recover(listener)`, so KahaDB and the memory store run exactly the code they run today. The proxy stores delegate it. - The JDBC store overrides it and applies the limit to the query (`setMaxRows`). Its listener already stops at the page size (AMQ-6067), so what a browse returns or expires doesn't change; pgjdbc just no longer loads the whole topic first. - `Topic.doBrowse()` passes its page size. No store-type checks; this also covers a JMX browse. On PostgreSQL, with this patch 6.3.2 and 6.2.10 survive the 200,000-message backlog from #2630 with a 1 GB heap, where unpatched they run out of memory ([CI run](https://github.com/papinifrancesco/activemq-jdbc-topic-expiry-oom/actions/runs/37823663429)). New H2 test: `JDBCTopicBrowseLimitTest`. One question: you added `MessageRecoveryContext` (AMQ-9646). Would you rather the JDBC store implement `recoverMessages(MessageRecoveryContext)` and the browse go through it? A plain overload kept this change small, since JDBC has no implementation of the context's offset and start/end ids yet. The rest is now #2640: on the JDBC store, expiry acks can lose pending messages or redeliver consumed ones, with tests for both. The previous version of this PR is linked there as one possible fix. @cshannon: with this version, KahaDB's code path is unchanged. **Disclosure:** as before, the change, the tests and the reproduction were written with an AI assistant (Claude Code, Anthropic). The test results come from local runs and the linked CI run. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information, visit: https://activemq.apache.org/contact
