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 af32ee8ef49 CAMEL-21777: Add description output in JMX mbean and dev console af32ee8ef49 is described below commit af32ee8ef49faca2f5d8c0a16e5e751eea7ca46d Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Feb 28 10:21:58 2025 +0100 CAMEL-21777: Add description output in JMX mbean and dev console --- .../java/org/apache/camel/impl/console/RouteDevConsole.java | 12 ++++++++++++ .../camel/api/management/mbean/ManagedProcessorMBean.java | 3 +++ .../org/apache/camel/management/mbean/ManagedProcessor.java | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/core/camel-console/src/main/java/org/apache/camel/impl/console/RouteDevConsole.java b/core/camel-console/src/main/java/org/apache/camel/impl/console/RouteDevConsole.java index 749c4060f99..a3b746d0bf2 100644 --- a/core/camel-console/src/main/java/org/apache/camel/impl/console/RouteDevConsole.java +++ b/core/camel-console/src/main/java/org/apache/camel/impl/console/RouteDevConsole.java @@ -93,6 +93,9 @@ public class RouteDevConsole extends AbstractDevConsole { if (mrb.getNodePrefixId() != null) { sb.append(String.format(" Node Prefix Id: %s", mrb.getNodePrefixId())); } + if (mrb.getDescription() != null) { + sb.append(String.format(" Description: %s", mrb.getDescription())); + } sb.append(String.format("\n From: %s", mrb.getEndpointUri())); sb.append(String.format("\n Remote: %s", mrb.isRemoteEndpoint())); if (mrb.getSourceLocation() != null) { @@ -197,6 +200,9 @@ public class RouteDevConsole extends AbstractDevConsole { if (mp.getNodePrefixId() != null) { sb.append(String.format("\n Node Prefix Id: %s", mp.getNodePrefixId())); } + if (mp.getDescription() != null) { + sb.append(String.format("\n Description: %s", mp.getDescription())); + } sb.append(String.format("\n Processor: %s", mp.getProcessorName())); sb.append(String.format("\n Level: %d", mp.getLevel())); if (mp.getSourceLocation() != null) { @@ -255,6 +261,9 @@ public class RouteDevConsole extends AbstractDevConsole { if (mrb.getNodePrefixId() != null) { jo.put("nodePrefixId", mrb.getNodePrefixId()); } + if (mrb.getDescription() != null) { + jo.put("description", mrb.getDescription()); + } jo.put("from", mrb.getEndpointUri()); jo.put("remote", mrb.isRemoteEndpoint()); if (mrb.getSourceLocation() != null) { @@ -354,6 +363,9 @@ public class RouteDevConsole extends AbstractDevConsole { if (mp.getNodePrefixId() != null) { jo.put("nodePrefixId", mp.getNodePrefixId()); } + if (mp.getDescription() != null) { + jo.put("description", mp.getDescription()); + } if (mp.getSourceLocation() != null) { String loc = mp.getSourceLocation(); if (mp.getSourceLineNumber() != null) { diff --git a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedProcessorMBean.java b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedProcessorMBean.java index f1eb56649c1..283c3017102 100644 --- a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedProcessorMBean.java +++ b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedProcessorMBean.java @@ -45,6 +45,9 @@ public interface ManagedProcessorMBean extends ManagedPerformanceCounterMBean { @ManagedAttribute(description = "Processor Name (Short)") String getProcessorName(); + @ManagedAttribute(description = "Processor Description") + String getDescription(); + @ManagedAttribute(description = "Processor Index") Integer getIndex(); diff --git a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java index 90a8d8281b2..1ec1da3624b 100644 --- a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java +++ b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedProcessor.java @@ -184,6 +184,11 @@ public class ManagedProcessor extends ManagedPerformanceCounter implements Manag return definition.getShortName(); } + @Override + public String getDescription() { + return definition.getDescription(); + } + @Override public void start() throws Exception { if (!context.getStatus().isStarted()) {