This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch ra in repository https://gitbox.apache.org/repos/asf/camel.git
commit eeab99d7a2b0cec35dd8b1ad03e4e9bfe80fc68e Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Mon May 27 14:16:25 2024 +0200 CAMEL-20798: Add RemoteAddress to endpoints so they can tell the url/hostname etc for the system it connects. This is needed for better monitoring, tracing and management. Add this information into camel-tracer as tags. --- .../org/apache/camel/dev-console/knative.json | 15 --- .../services/org/apache/camel/dev-console/knative | 2 - .../org/apache/camel/dev-consoles.properties | 7 - .../services/org/apache/camel/other.properties | 7 - .../component/knative/http/KnativeHttpConsole.java | 141 --------------------- .../org/apache/camel/dev-console/mina.json | 15 --- .../services/org/apache/camel/dev-console/mina | 2 - .../apache/camel/component/mina/MinaConsole.java | 88 ------------- .../org/apache/camel/dev-console/mllp.json | 15 --- .../services/org/apache/camel/dev-console/mllp | 2 - .../apache/camel/component/mllp/MllpConsole.java | 79 ------------ .../org/apache/camel/dev-console/netty.json | 15 --- .../services/org/apache/camel/dev-console/netty | 2 - .../apache/camel/component/netty/NettyConsole.java | 88 ------------- .../camel/cli/connector/LocalCliConnector.java | 60 +-------- 15 files changed, 7 insertions(+), 531 deletions(-) diff --git a/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/org/apache/camel/dev-console/knative.json b/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/org/apache/camel/dev-console/knative.json deleted file mode 100644 index d9a411abcbe..00000000000 --- a/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/org/apache/camel/dev-console/knative.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "console": { - "kind": "console", - "group": "camel", - "name": "knative", - "title": "Knative", - "description": "Knative HTTP Service", - "deprecated": false, - "javaType": "org.apache.camel.component.knative.http.KnativeHttpConsole", - "groupId": "org.apache.camel", - "artifactId": "camel-knative-http", - "version": "4.7.0-SNAPSHOT" - } -} - diff --git a/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/dev-console/knative b/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/dev-console/knative deleted file mode 100644 index 2444b43c411..00000000000 --- a/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/dev-console/knative +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.knative.http.KnativeHttpConsole diff --git a/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/dev-consoles.properties b/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/dev-consoles.properties deleted file mode 100644 index 84c958d2f19..00000000000 --- a/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/dev-consoles.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Generated by camel build tools - do NOT edit this file! -dev-consoles=knative -groupId=org.apache.camel -artifactId=camel-knative-http -version=4.7.0-SNAPSHOT -projectName=Camel :: Knative HTTP -projectDescription=Camel Knative HTTP diff --git a/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/other.properties deleted file mode 100644 index 5f4da03c7a6..00000000000 --- a/components/camel-knative/camel-knative-http/src/generated/resources/META-INF/services/org/apache/camel/other.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Generated by camel build tools - do NOT edit this file! -name=knative-http -groupId=org.apache.camel -artifactId=camel-knative-http -version=4.7.0-SNAPSHOT -projectName=Camel :: Knative HTTP -projectDescription=Camel Knative HTTP diff --git a/components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsole.java b/components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsole.java deleted file mode 100644 index 457c6a12c3f..00000000000 --- a/components/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsole.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.knative.http; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.management.MBeanServer; -import javax.management.ObjectName; - -import org.apache.camel.Consumer; -import org.apache.camel.Route; -import org.apache.camel.Service; -import org.apache.camel.api.management.ManagedCamelContext; -import org.apache.camel.spi.annotations.DevConsole; -import org.apache.camel.support.console.AbstractDevConsole; -import org.apache.camel.util.StringHelper; -import org.apache.camel.util.json.JsonObject; - -@DevConsole(name = "knative", displayName = "Knative", description = "Knative HTTP Service") -public class KnativeHttpConsole extends AbstractDevConsole { - - public KnativeHttpConsole() { - super("camel", "knative", "Knative", "Knative HTTP Service"); - } - - @Override - protected String doCallText(Map<String, Object> options) { - StringBuilder sb = new StringBuilder(); - - // find if we use MainHttpServer and get its configuration for url - ManagedCamelContext mcc = getCamelContext().getCamelContextExtension().getContextPlugin(ManagedCamelContext.class); - if (mcc != null) { - String host = null; - int port = -1; - String path = null; - try { - Service service = getCamelContext().hasService(s -> s.getClass().getSimpleName().equals("MainHttpServer")); - if (service != null) { - MBeanServer mBeanServer = getCamelContext().getManagementStrategy().getManagementAgent().getMBeanServer(); - ObjectName on = getCamelContext().getManagementStrategy().getManagementObjectNameStrategy() - .getObjectNameForService(getCamelContext(), service); - host = (String) mBeanServer.getAttribute(on, "Host"); - port = (int) mBeanServer.getAttribute(on, "Port"); - path = (String) mBeanServer.getAttribute(on, "Path"); - } - } catch (Exception e) { - // ignore - } - - List<Consumer> list = getCamelContext().getRoutes() - .stream().map(Route::getConsumer) - .filter(c -> KnativeHttpConsumer.class.getName().equals(c.getClass().getName())) - .toList(); - - for (Consumer c : list) { - KnativeHttpConsumer knc = (KnativeHttpConsumer) c; - if (host != null) { - String p = path != null ? path + "/" + knc.getPath() : knc.getPath(); - // remove leading slashes - p = StringHelper.removeStartingCharacters(p, '/'); - sb.append(String.format(" %s://%s:%d/%s\n", "http", host, port, p)); - } else { - sb.append(String.format(" %s://%s\n", "http", knc.getPath())); - } - - } - } - - return sb.toString(); - } - - @Override - protected JsonObject doCallJson(Map<String, Object> options) { - JsonObject root = new JsonObject(); - - ManagedCamelContext mcc = getCamelContext().getCamelContextExtension().getContextPlugin(ManagedCamelContext.class); - if (mcc != null) { - String host = null; - int port = -1; - String path = null; - try { - Service service = getCamelContext().hasService(s -> s.getClass().getSimpleName().equals("MainHttpServer")); - if (service != null) { - MBeanServer mBeanServer = getCamelContext().getManagementStrategy().getManagementAgent().getMBeanServer(); - ObjectName on = getCamelContext().getManagementStrategy().getManagementObjectNameStrategy() - .getObjectNameForService(getCamelContext(), service); - host = (String) mBeanServer.getAttribute(on, "Host"); - port = (int) mBeanServer.getAttribute(on, "Port"); - path = (String) mBeanServer.getAttribute(on, "Path"); - } - } catch (Exception e) { - // ignore - } - List<Consumer> list = getCamelContext().getRoutes() - .stream().map(Route::getConsumer) - .filter(c -> KnativeHttpConsumer.class.getName().equals(c.getClass().getName())) - .toList(); - - List<JsonObject> arr = new ArrayList<>(); - for (Consumer c : list) { - KnativeHttpConsumer knc = (KnativeHttpConsumer) c; - - JsonObject jo = new JsonObject(); - jo.put("protocol", "http"); - if (host != null) { - jo.put("host", host); - } - if (port != -1) { - jo.put("port", port); - } - String p = path != null ? path + "/" + knc.getPath() : knc.getPath(); - // remove leading slashes - p = StringHelper.removeStartingCharacters(p, '/'); - jo.put("path", p); - arr.add(jo); - } - if (!arr.isEmpty()) { - root.put("consumers", arr); - } - } - - return root; - } - -} diff --git a/components/camel-mina/src/generated/resources/META-INF/org/apache/camel/dev-console/mina.json b/components/camel-mina/src/generated/resources/META-INF/org/apache/camel/dev-console/mina.json deleted file mode 100644 index 0c8b7a7431c..00000000000 --- a/components/camel-mina/src/generated/resources/META-INF/org/apache/camel/dev-console/mina.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "console": { - "kind": "console", - "group": "camel", - "name": "mina", - "title": "Mina", - "description": "Embedded Mina Server", - "deprecated": false, - "javaType": "org.apache.camel.component.mina.MinaConsole", - "groupId": "org.apache.camel", - "artifactId": "camel-mina", - "version": "4.7.0-SNAPSHOT" - } -} - diff --git a/components/camel-mina/src/generated/resources/META-INF/services/org/apache/camel/dev-console/mina b/components/camel-mina/src/generated/resources/META-INF/services/org/apache/camel/dev-console/mina deleted file mode 100644 index dfb0794d60d..00000000000 --- a/components/camel-mina/src/generated/resources/META-INF/services/org/apache/camel/dev-console/mina +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.mina.MinaConsole diff --git a/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsole.java b/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsole.java deleted file mode 100644 index cafde44205e..00000000000 --- a/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsole.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.mina; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.apache.camel.Consumer; -import org.apache.camel.Route; -import org.apache.camel.spi.annotations.DevConsole; -import org.apache.camel.support.console.AbstractDevConsole; -import org.apache.camel.util.json.JsonObject; - -@DevConsole(name = "mina", description = "Embedded Mina Server") -public class MinaConsole extends AbstractDevConsole { - - public MinaConsole() { - super("camel", "mina", "Mina", "Embedded Mina Server"); - } - - @Override - protected String doCallText(Map<String, Object> options) { - StringBuilder sb = new StringBuilder(); - - List<Consumer> list = getCamelContext().getRoutes() - .stream().map(Route::getConsumer) - .filter(c -> MinaConsumer.class.getName().equals(c.getClass().getName())) - .collect(Collectors.toList()); - - for (Consumer c : list) { - MinaConsumer nc = (MinaConsumer) c; - MinaConfiguration conf = nc.getEndpoint().getConfiguration(); - // skip client mode as then it is not a local service - if (!conf.isClientMode()) { - sb.append(String.format(" %s:%s:%d\n", conf.getProtocol(), conf.getHost(), conf.getPort())); - } - } - - return sb.toString(); - } - - @Override - protected JsonObject doCallJson(Map<String, Object> options) { - JsonObject root = new JsonObject(); - - List<Consumer> list = getCamelContext().getRoutes() - .stream().map(Route::getConsumer) - .filter(c -> MinaConsumer.class.getName().equals(c.getClass().getName())) - .collect(Collectors.toList()); - - List<JsonObject> arr = new ArrayList<>(); - for (Consumer c : list) { - MinaConsumer nc = (MinaConsumer) c; - MinaConfiguration conf = nc.getEndpoint().getConfiguration(); - - if (!conf.isClientMode()) { - // skip client mode as then it is not a local service - JsonObject jo = new JsonObject(); - jo.put("protocol", conf.getProtocol()); - jo.put("host", conf.getHost()); - jo.put("port", conf.getPort()); - arr.add(jo); - } - } - if (!arr.isEmpty()) { - root.put("consumers", arr); - } - - return root; - } - -} diff --git a/components/camel-mllp/src/generated/resources/META-INF/org/apache/camel/dev-console/mllp.json b/components/camel-mllp/src/generated/resources/META-INF/org/apache/camel/dev-console/mllp.json deleted file mode 100644 index cd3b7f4ee90..00000000000 --- a/components/camel-mllp/src/generated/resources/META-INF/org/apache/camel/dev-console/mllp.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "console": { - "kind": "console", - "group": "camel", - "name": "mllp", - "title": "MLLP", - "description": "Embedded MLLP Server", - "deprecated": false, - "javaType": "org.apache.camel.component.mllp.MllpConsole", - "groupId": "org.apache.camel", - "artifactId": "camel-mllp", - "version": "4.7.0-SNAPSHOT" - } -} - diff --git a/components/camel-mllp/src/generated/resources/META-INF/services/org/apache/camel/dev-console/mllp b/components/camel-mllp/src/generated/resources/META-INF/services/org/apache/camel/dev-console/mllp deleted file mode 100644 index f4eb9582c32..00000000000 --- a/components/camel-mllp/src/generated/resources/META-INF/services/org/apache/camel/dev-console/mllp +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.mllp.MllpConsole diff --git a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpConsole.java b/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpConsole.java deleted file mode 100644 index d3beedc2423..00000000000 --- a/components/camel-mllp/src/main/java/org/apache/camel/component/mllp/MllpConsole.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.mllp; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.apache.camel.Consumer; -import org.apache.camel.Route; -import org.apache.camel.spi.annotations.DevConsole; -import org.apache.camel.support.console.AbstractDevConsole; -import org.apache.camel.util.json.JsonObject; - -@DevConsole(name = "mllp", displayName = "MLLP", description = "Embedded MLLP Server") -public class MllpConsole extends AbstractDevConsole { - - public MllpConsole() { - super("camel", "mllp", "MLLP", "Embedded MLLP Server"); - } - - @Override - protected String doCallText(Map<String, Object> options) { - StringBuilder sb = new StringBuilder(); - - List<Consumer> list = getCamelContext().getRoutes() - .stream().map(Route::getConsumer) - .filter(c -> c instanceof MllpTcpServerConsumer) - .collect(Collectors.toList()); - - for (Consumer c : list) { - MllpTcpServerConsumer nc = (MllpTcpServerConsumer) c; - sb.append(String.format(" mllp:%s:%d\n", nc.getEndpoint().getHostname(), nc.getEndpoint().getPort())); - } - - return sb.toString(); - } - - @Override - protected JsonObject doCallJson(Map<String, Object> options) { - JsonObject root = new JsonObject(); - - List<Consumer> list = getCamelContext().getRoutes() - .stream().map(Route::getConsumer) - .filter(c -> c instanceof MllpTcpServerConsumer) - .collect(Collectors.toList()); - - List<JsonObject> arr = new ArrayList<>(); - for (Consumer c : list) { - MllpTcpServerConsumer nc = (MllpTcpServerConsumer) c; - JsonObject jo = new JsonObject(); - jo.put("protocol", "mllp"); - jo.put("host", nc.getEndpoint().getHostname()); - jo.put("port", nc.getEndpoint().getPort()); - arr.add(jo); - } - if (!arr.isEmpty()) { - root.put("consumers", arr); - } - - return root; - } - -} diff --git a/components/camel-netty/src/generated/resources/META-INF/org/apache/camel/dev-console/netty.json b/components/camel-netty/src/generated/resources/META-INF/org/apache/camel/dev-console/netty.json deleted file mode 100644 index b48c14f3ce1..00000000000 --- a/components/camel-netty/src/generated/resources/META-INF/org/apache/camel/dev-console/netty.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "console": { - "kind": "console", - "group": "camel", - "name": "netty", - "title": "Netty", - "description": "Embedded Netty Server", - "deprecated": false, - "javaType": "org.apache.camel.component.netty.NettyConsole", - "groupId": "org.apache.camel", - "artifactId": "camel-netty", - "version": "4.7.0-SNAPSHOT" - } -} - diff --git a/components/camel-netty/src/generated/resources/META-INF/services/org/apache/camel/dev-console/netty b/components/camel-netty/src/generated/resources/META-INF/services/org/apache/camel/dev-console/netty deleted file mode 100644 index cba5e6691ad..00000000000 --- a/components/camel-netty/src/generated/resources/META-INF/services/org/apache/camel/dev-console/netty +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.netty.NettyConsole diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConsole.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConsole.java deleted file mode 100644 index c99c2357adf..00000000000 --- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConsole.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.netty; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.apache.camel.Consumer; -import org.apache.camel.Route; -import org.apache.camel.spi.annotations.DevConsole; -import org.apache.camel.support.console.AbstractDevConsole; -import org.apache.camel.util.json.JsonObject; - -@DevConsole(name = "netty", description = "Embedded Netty Server") -public class NettyConsole extends AbstractDevConsole { - - public NettyConsole() { - super("camel", "netty", "Netty", "Embedded Netty Server"); - } - - @Override - protected String doCallText(Map<String, Object> options) { - StringBuilder sb = new StringBuilder(); - - List<Consumer> list = getCamelContext().getRoutes() - .stream().map(Route::getConsumer) - .filter(c -> NettyConsumer.class.getName().equals(c.getClass().getName())) - .collect(Collectors.toList()); - - for (Consumer c : list) { - NettyConsumer nc = (NettyConsumer) c; - NettyConfiguration conf = nc.getConfiguration(); - // skip client mode as then it is not a local service - if (!conf.isClientMode()) { - sb.append(String.format(" %s:%s:%d\n", conf.getProtocol(), conf.getHost(), conf.getPort())); - } - } - - return sb.toString(); - } - - @Override - protected JsonObject doCallJson(Map<String, Object> options) { - JsonObject root = new JsonObject(); - - List<Consumer> list = getCamelContext().getRoutes() - .stream().map(Route::getConsumer) - .filter(c -> NettyConsumer.class.getName().equals(c.getClass().getName())) - .collect(Collectors.toList()); - - List<JsonObject> arr = new ArrayList<>(); - for (Consumer c : list) { - NettyConsumer nc = (NettyConsumer) c; - NettyConfiguration conf = nc.getConfiguration(); - - if (!conf.isClientMode()) { - // skip client mode as then it is not a local service - JsonObject jo = new JsonObject(); - jo.put("protocol", conf.getProtocol()); - jo.put("host", conf.getHost()); - jo.put("port", conf.getPort()); - arr.add(jo); - } - } - if (!arr.isEmpty()) { - root.put("consumers", arr); - } - - return root; - } - -} diff --git a/dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java b/dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java index 0a84c3294b3..1fdfb264407 100644 --- a/dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java +++ b/dsl/camel-cli-connector/src/main/java/org/apache/camel/cli/connector/LocalCliConnector.java @@ -969,12 +969,15 @@ public class LocalCliConnector extends ServiceSupport implements CliConnector, C root.put("transformers", json); } } + DevConsole dc17 = dcr.resolveById("service"); + if (dc17 != null) { + JsonObject json = (JsonObject) dc17.call(DevConsole.MediaType.JSON); + if (json != null && !json.isEmpty()) { + root.put("services", json); + } + } } // various details - JsonObject services = collectServices(); - if (!services.isEmpty()) { - root.put("services", services); - } JsonObject mem = collectMemory(); if (mem != null) { root.put("memory", mem); @@ -1087,55 +1090,6 @@ public class LocalCliConnector extends ServiceSupport implements CliConnector, C return root; } - private JsonObject collectServices() { - JsonObject root = new JsonObject(); - - // platform-http is optional - if (camelContext.hasComponent("platform-http") != null) { - Optional<DevConsole> dc = PluginHelper.getDevConsoleResolver(camelContext).lookupDevConsole("platform-http"); - if (dc.isPresent()) { - JsonObject json = (JsonObject) dc.get().call(DevConsole.MediaType.JSON); - if (json != null) { - root.put("platform-http", json); - } - } - } - // netty is optional - Optional<DevConsole> dc = PluginHelper.getDevConsoleResolver(camelContext).lookupDevConsole("netty"); - if (dc.isPresent()) { - JsonObject json = (JsonObject) dc.get().call(DevConsole.MediaType.JSON); - if (json != null) { - root.put("netty", json); - } - } - // mina is optional - dc = PluginHelper.getDevConsoleResolver(camelContext).lookupDevConsole("mina"); - if (dc.isPresent()) { - JsonObject json = (JsonObject) dc.get().call(DevConsole.MediaType.JSON); - if (json != null) { - root.put("mina", json); - } - } - // mllp is optional - dc = PluginHelper.getDevConsoleResolver(camelContext).lookupDevConsole("mllp"); - if (dc.isPresent()) { - JsonObject json = (JsonObject) dc.get().call(DevConsole.MediaType.JSON); - if (json != null) { - root.put("mllp", json); - } - } - // knative is optional - dc = PluginHelper.getDevConsoleResolver(camelContext).lookupDevConsole("knative"); - if (dc.isPresent()) { - JsonObject json = (JsonObject) dc.get().call(DevConsole.MediaType.JSON); - if (json != null) { - root.put("knative", json); - } - } - - return root; - } - @Override protected void doStop() throws Exception { // cleanup