You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2021/06/16 04:13:31 UTC

[james-project] 03/05: JAMES-3599 GroupRegistration : nack is blocking

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit c6e63d908bca438411f5c7db6b05e990356b2325
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Jun 14 15:09:37 2021 +0700

    JAMES-3599 GroupRegistration : nack is blocking
    
    Thus it should be scheduled on the elastic scheduler
---
 .../main/java/org/apache/james/events/GroupRegistration.java   | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/event-bus/distributed/src/main/java/org/apache/james/events/GroupRegistration.java b/event-bus/distributed/src/main/java/org/apache/james/events/GroupRegistration.java
index 57839ef..5b5ce39 100644
--- a/event-bus/distributed/src/main/java/org/apache/james/events/GroupRegistration.java
+++ b/event-bus/distributed/src/main/java/org/apache/james/events/GroupRegistration.java
@@ -121,11 +121,7 @@ class GroupRegistration implements Registration {
                 .durable(DURABLE)
                 .exclusive(!EXCLUSIVE)
                 .autoDelete(!AUTO_DELETE)
-                .arguments(deadLetterQueue(namingStrategy.deadLetterExchange())),
-            BindingSpecification.binding()
-                .exchange(namingStrategy.exchange())
-                .queue(queueName.asString())
-                .routingKey(EMPTY_ROUTING_KEY));
+                .arguments(deadLetterQueue(namingStrategy.deadLetterExchange())));
     }
 
     private Disposable consumeWorkQueue() {
@@ -148,7 +144,9 @@ class GroupRegistration implements Registration {
                 .then(Mono.<Void>fromRunnable(acknowledgableDelivery::ack).subscribeOn(Schedulers.elastic())))
             .onErrorResume(e -> {
                 LOGGER.error("Unable to process delivery for group {}", group, e);
-                return Mono.fromRunnable(() -> acknowledgableDelivery.nack(!REQUEUE));
+                return Mono.fromRunnable(() -> acknowledgableDelivery.nack(!REQUEUE))
+                    .subscribeOn(Schedulers.elastic())
+                    .then();
             });
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org