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

btellier 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 9d54384f9f JAMES-3817 RabbitMQEventBusDeadLetterQueueHealthCheck is 
making blocking calls (#1261)
9d54384f9f is described below

commit 9d54384f9f744cd6bfbc09dbebe826b70a67d46d
Author: Benoit TELLIER <[email protected]>
AuthorDate: Fri Oct 21 10:28:56 2022 +0700

    JAMES-3817 RabbitMQEventBusDeadLetterQueueHealthCheck is making blocking 
calls (#1261)
---
 .../james/events/RabbitMQEventBusDeadLetterQueueHealthCheck.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/event-bus/distributed/src/main/java/org/apache/james/events/RabbitMQEventBusDeadLetterQueueHealthCheck.java
 
b/event-bus/distributed/src/main/java/org/apache/james/events/RabbitMQEventBusDeadLetterQueueHealthCheck.java
index 6eeb2af045..736a02126c 100644
--- 
a/event-bus/distributed/src/main/java/org/apache/james/events/RabbitMQEventBusDeadLetterQueueHealthCheck.java
+++ 
b/event-bus/distributed/src/main/java/org/apache/james/events/RabbitMQEventBusDeadLetterQueueHealthCheck.java
@@ -28,6 +28,7 @@ import org.apache.james.core.healthcheck.HealthCheck;
 import org.apache.james.core.healthcheck.Result;
 
 import reactor.core.publisher.Mono;
+import reactor.core.scheduler.Schedulers;
 
 public class RabbitMQEventBusDeadLetterQueueHealthCheck implements HealthCheck 
{
     public static final ComponentName COMPONENT_NAME = new 
ComponentName("RabbitMQEventBusDeadLetterQueueHealthCheck");
@@ -60,6 +61,7 @@ public class RabbitMQEventBusDeadLetterQueueHealthCheck 
implements HealthCheck {
                 }
                 return Result.healthy(COMPONENT_NAME);
             })
-            .onErrorResume(e -> Mono.just(Result.unhealthy(COMPONENT_NAME, 
"Error checking RabbitMQEventBusDeadLetterHealthCheck", e)));
+            .onErrorResume(e -> Mono.just(Result.unhealthy(COMPONENT_NAME, 
"Error checking RabbitMQEventBusDeadLetterHealthCheck", e)))
+            .subscribeOn(Schedulers.boundedElastic()); // Reading the 
management API is blocking
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to