Map<String, String> map = new HashMap<String, String>();
map.put("context", "localhost/" + getContext().getName());
map.put("type", "routes");
map.put("name", "\"monitorRoute\"");
JMXUriBuilder jmxUriBuilder = new JMXUriBuilder("platform")
.withObjectDomain("org.apache.camel")
.withObjectProperties(map)
.withMonitorType("counter")
.withObservedAttribute("ExchangesCompleted")
.withInitThreshold(0)
.withGranularityPeriod(500)
.withOffset(1)
.withDifferenceMode(false);
log.info("jmxUri = {}", jmxUriBuilder.toString());
from(jmxUriBuilder.toString())
.routeId("jmxMonitor")
.log("${body}")
.to("mock:monitor");
}