Jolokia Java client to start and stop camel context

classic Classic list List threaded Threaded
1 message Options
Pallavi G S Pallavi G S
Reply | Threaded
Open this post in threaded view
|

Jolokia Java client to start and stop camel context

I need Jolokia Client to get all camel context,then start and stop context when required.

From the below code

J4pClient j4pClient = new J4pClient("http://{ip}:{port}/jolokia/read/");
                J4pReadRequest req = new J4pReadRequest("org.apache.camel:type=context,*");
                J4pReadResponse resp = j4pClient.execute(req);
                Map<String,String> vals = resp.getValue();


Im getting Exception as follows,

org.jolokia.client.exception.J4pRemoteException: java.lang.IllegalArgumentException : No matching attributes [] found on MBeans

on the line
J4pReadResponse resp = j4pClient.execute(req);

How can I start and stop the camel context?