davsclaus commented on code in PR #17656:
URL: https://github.com/apache/camel/pull/17656#discussion_r2028964223


##########
core/camel-health/src/main/java/org/apache/camel/impl/health/ContextHealthCheck.java:
##########
@@ -50,16 +51,36 @@ protected void doCall(HealthCheckResultBuilder builder, 
Map<String, Object> opti
         builder.unknown();
 
         if (getCamelContext() != null) {
-            builder.detail("context.name", getCamelContext().getName());
+            ServiceStatus status = getCamelContext().getStatus();
+            byte phase = 
getCamelContext().getCamelContextExtension().getStatusPhase();
+            String name = getCamelContext().getName();
+
+            builder.detail("context.name", name);
             builder.detail("context.version", getCamelContext().getVersion());
-            builder.detail("context.status", 
getCamelContext().getStatus().name());
-            builder.detail("context.phase", 
getCamelContext().getCamelContextExtension().getStatusPhase());
+            builder.detail("context.status", status);
+            builder.detail("context.phase", phase);
 
-            if (getCamelContext().getStatus().isStarted()) {
-                builder.up();
-            } else {
-                // not ready also during graceful shutdown
-                builder.down();
+            switch (status) {
+                case Initializing:
+                case Initialized:
+                case Starting:
+                    builder.message(
+                            "Camel Context '" + name + "' is starting. Status: 
'" + status + "', Phase: '" + phase
+                                    + "'. Please wait...");
+                    builder.down();
+                    break;
+                case Started:
+                    builder.up();
+                case Stopping:
+                case Stopped:
+                case Suspending:
+                case Suspended:
+                    builder.message("Camel Context '" + name + "'  is shutting 
down. Status: '" + status + "', Phase: '" + phase

Review Comment:
   There is still a double space here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to