mattrpav commented on code in PR #2634:
URL: https://github.com/apache/activemq/pull/2634#discussion_r4456045242
##########
activemq-broker/src/main/java/org/apache/activemq/store/MessageStore.java:
##########
@@ -138,6 +138,21 @@ public interface MessageStore extends Service {
*/
void recover(MessageRecoveryListener container) throws Exception;
+ /**
+ * Recover at most maxReturned messages to be delivered.
+ *
+ * The default implementation relies on {@link
MessageRecoveryListener#hasSpace()} to
+ * stop the recovery. A store that would otherwise read every message
before the
+ * listener can stop it should bound the read itself.
+ *
+ * @param listener
+ * @param maxReturned the maximum number of messages to recover
+ * @throws Exception
+ */
+ default void recover(MessageRecoveryListener listener, int maxReturned)
throws Exception {
Review Comment:
We already have this method that should meet the need, right?
```
void recoverNextMessages(int maxReturned, MessageRecoveryListener listener)
throws Exception;
```
--
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