Hi Arjan,
Thanks for your interest in Camel. Enabling JMX in your code is fairly
easy. This is what you have to do:
protected InstrumentationAgent iAgent;
[...]
CamelContext context = new DefaultCamelContext();
iAgent = new InstrumentationAgentImpl();
iAgent.setCamelContext(context);
iAgent.enableJmx(null, 0);
iAgent.start();
You can then use jconsole to connect to
"service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi" and see your
metrics (you can pass your own domain name and port in enableJmx() if
you want to override the defaults: "org.apache.camel" and "1099").
If you got the source from the apache repository you can take a look at:
camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationUsingDefaultsTest.java
Please keep an eye on the jira's James created too.
Cheers
Hadrian
Arjan Moraal wrote:
James.Strachan wrote:
We've been adding some JMX metrics so you can see throughput through
endpoints and so forth (rather like folks monitor JMS queues using JMX
stats). Try using trunk (as many of these changes were made after
1.2.0), enable JMX
<camelContext useJmx="true" ... />
That's about what we need I think. Do you know how to enable it from Java
code? We're not using Spring configuration but just start Camel from a
standalone Java app by calling
CamelContext context = new DefaultCamelContext();
Thanks,
Arjan