Skip to content

Commit

Permalink
[FIX] Better error management for DeletedMessageVault consumer (#2651)
Browse files Browse the repository at this point in the history
Otherwise, blobstore errors for example could crash the DTM consumer.

Co-authored-by: Benoit TELLIER <btellier@linagora.com>
  • Loading branch information
quantranhong1999 and chibenwa authored Mar 3, 2025
1 parent 978540c commit 4da699c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private Disposable consumeDeletedMessageVaultWorkQueue() {
receiverProvider::createReceiver,
receiver -> receiver.consumeManualAck(QUEUE, new ConsumeOptions().qos(QOS)),
Receiver::close)
.flatMap(this::handleMessage)
.flatMap(this::handleMessage, QOS)
.subscribeOn(Schedulers.boundedElastic())
.subscribe();
}
Expand All @@ -248,9 +248,10 @@ private Mono<Void> handleMessage(AcknowledgableDelivery delivery) {

return callback.forMessage(copyCommandDTO.asPojo(mailboxIdFactory, messageIdFactory, blobIdFactory))
.timeout(Duration.ofMinutes(5))
.doOnError(e -> {
.onErrorResume(e -> {
LOGGER.error("Failed executing deletion callback for {}", copyCommandDTO.messageId, e);
delivery.nack(REQUEUE);
return Mono.empty();
})
.doOnSuccess(any -> delivery.ack())
.doOnCancel(() -> delivery.nack(REQUEUE));
Expand Down

0 comments on commit 4da699c

Please sign in to comment.