This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-2.22.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-2.22.x by this push: new 2284b8c CAMEL-13093 (#2724) 2284b8c is described below commit 2284b8c8440f86d6f55c509143a38663b461c836 Author: 1984shekhar <chandrashekharpan...@hotmail.com> AuthorDate: Tue Jan 22 01:02:33 2019 +0530 CAMEL-13093 (#2724) * karaf route-profile command improvement * CAMEL-13093: karaf route-profile command improvement --- .../apache/camel/commands/AbstractLocalCamelController.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java index ae1cf30..89adc8c 100644 --- a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java +++ b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java @@ -390,13 +390,11 @@ public abstract class AbstractLocalCamelController extends AbstractCamelControll ManagementAgent agent = context.getManagementStrategy().getManagementAgent(); if (agent != null) { MBeanServer mBeanServer = agent.getMBeanServer(); - Set<ObjectName> set = mBeanServer.queryNames(new ObjectName(agent.getMBeanObjectDomainName() + ":type=routes,name=\"" + routeId + "\",*"), null); - Iterator<ObjectName> iterator = set.iterator(); - if (iterator.hasNext()) { - ObjectName routeMBean = iterator.next(); - - // the route must be part of the camel context - String camelId = (String) mBeanServer.getAttribute(routeMBean, "CamelId"); + Set<ObjectName> set = mBeanServer.queryNames(new ObjectName(agent.getMBeanObjectDomainName() + ":type=routes,name=\"" + routeId + "\",*"), null); + for (ObjectName routeMBean : set) { + + // the route must be part of the camel context + String camelId = (String) mBeanServer.getAttribute(routeMBean, "CamelId"); if (camelId != null && camelId.equals(camelContextName)) { String xml = (String) mBeanServer.invoke(routeMBean, "dumpRouteStatsAsXml", new Object[]{fullStats, includeProcessors}, new String[]{"boolean", "boolean"}); return xml;