You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/05/10 16:31:01 UTC

[camel] branch main updated: CAMEL-18091: camel-jbang - Health Check should report HTTP status code 500 for DOWN

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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 7368469817c CAMEL-18091: camel-jbang - Health Check should report HTTP status code 500 for DOWN
7368469817c is described below

commit 7368469817cc0d1ce6afaaf35f7a6a88680f46bb
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue May 10 18:30:43 2022 +0200

    CAMEL-18091: camel-jbang - Health Check should report HTTP status code 500 for DOWN
---
 .../src/main/java/org/apache/camel/main/VertxHttpServer.java         | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/VertxHttpServer.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/VertxHttpServer.java
index b84bb2d2ce1..168ae5a81c6 100644
--- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/VertxHttpServer.java
+++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/VertxHttpServer.java
@@ -257,6 +257,11 @@ public final class VertxHttpServer {
                     healthCheckDetails(sb, downs, up);
                 }
                 sb.append("}\n");
+
+                if (!up) {
+                    // we need to fail with a http status so lets use 500
+                    ctx.response().setStatusCode(500);
+                }
                 ctx.end(sb.toString());
             }
         };