james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [12/14] james-project git commit: JAMES-2541 Fix concurrency issue in enqueuer
Date Mon, 17 Sep 2018 06:33:22 GMT
JAMES-2541 Fix concurrency issue in enqueuer


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/d8c5821d
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/d8c5821d
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/d8c5821d

Branch: refs/heads/master
Commit: d8c5821d6443e40e063fdccedc2051692a966ee4
Parents: 2279c6b
Author: Benoit Tellier <btellier@linagora.com>
Authored: Wed Sep 12 16:50:16 2018 +0700
Committer: Antoine Duprat <aduprat@linagora.com>
Committed: Mon Sep 17 08:14:16 2018 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/james/queue/rabbitmq/Enqueuer.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/d8c5821d/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Enqueuer.java
----------------------------------------------------------------------
diff --git a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Enqueuer.java
b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Enqueuer.java
index 1fcdde2..84d4921 100644
--- a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Enqueuer.java
+++ b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Enqueuer.java
@@ -55,7 +55,8 @@ class Enqueuer {
     void enQueue(Mail mail) throws MailQueue.MailQueueException {
         saveMail(mail)
             .thenAccept(Throwing.<MimeMessagePartsId>consumer(partsId -> publishReferenceToRabbit(mail,
partsId)).sneakyThrow())
-            .thenRun(enqueueMetric::increment);
+            .thenRun(enqueueMetric::increment)
+            .join();
     }
 
     private CompletableFuture<MimeMessagePartsId> saveMail(Mail mail) throws MailQueue.MailQueueException
{


---------------------------------------------------------------------
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