james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [james-project] branch master updated: Revert "JAMES-2733 RabbitMQ should not dequeue deleted elements"
Date Wed, 12 Jun 2019 14:07:59 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 8fbbb58  Revert "JAMES-2733 RabbitMQ should not dequeue deleted elements"
8fbbb58 is described below

commit 8fbbb587f7631d44cb17555a65217b2b14938c2f
Author: Rene Cordier <rcordier@linagora.com>
AuthorDate: Wed Jun 12 14:36:17 2019 +0700

    Revert "JAMES-2733 RabbitMQ should not dequeue deleted elements"
    
    This reverts commit 698cbc496d4d3e53092416e1055fde4e8479d547.
---
 .../java/org/apache/james/queue/rabbitmq/Dequeuer.java  | 17 ++---------------
 .../james/queue/rabbitmq/RabbitMQMailQueueTest.java     |  8 ++++++++
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Dequeuer.java
b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Dequeuer.java
index a2e7a7e..d053096 100644
--- a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Dequeuer.java
+++ b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Dequeuer.java
@@ -34,7 +34,6 @@ import org.apache.mailet.Mail;
 
 import com.github.fge.lambdas.consumers.ThrowingConsumer;
 import com.rabbitmq.client.Delivery;
-
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
 import reactor.rabbitmq.AcknowledgableDelivery;
@@ -81,20 +80,8 @@ class Dequeuer {
             .filter(getResponse -> getResponse.getBody() != null);
     }
 
-    Flux<? extends MailQueue.MailQueueItem> deQueue() {
-        return flux.flatMap(this::loadItem)
-            .flatMap(this::filterIfDeleted);
-    }
-
-    private Mono<RabbitMQMailQueueItem> filterIfDeleted(RabbitMQMailQueueItem item)
{
-        return mailQueueView.isPresent(item.getMail())
-            .flatMap(isPresent -> {
-                if (isPresent) {
-                    return Mono.just(item);
-                }
-                item.done(true);
-                return Mono.empty();
-            });
+    Flux<MailQueue.MailQueueItem> deQueue() {
+        return flux.flatMap(this::loadItem);
     }
 
     private Mono<RabbitMQMailQueueItem> loadItem(AcknowledgableDelivery response) {
diff --git a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
index 3d4d271..ec9e18b 100644
--- a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
+++ b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
@@ -233,6 +233,14 @@ public class RabbitMQMailQueueTest implements ManageableMailQueueContract,
MailQ
 
     }
 
+    @Disabled("JAMES-2733 Deleted elements are still dequeued")
+    @Test
+    @Override
+    public void deletedElementsShouldNotBeDequeued() {
+
+    }
+
+
     private void enqueueSomeMails(Function<Integer, String> namePattern, int emailCount)
{
         IntStream.rangeClosed(1, emailCount)
             .forEach(Throwing.intConsumer(i -> enQueue(defaultMail()


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


Mime
View raw message