How can JMX be used in Fuse 6.x (especially with Switchyard?)

Solution Unverified - Updated -

Environment

Red Hat JBoss Fuse 6.x

Issue

I'd like to monitor and administer my applications remotely. How can this be done in Fuse 6.x?

Resolution

Use Jolokia, provided with the Hawtio console application. Using Jolokia, you can manipulate the JMX MBeans provided with SwitchYard. (It will work for other things, too!)


// Invoke Jolokia like this. Note the user and password.

curl -u rick:MyPasswordGoesHere http://localhost:8080/hawtio/jolokia/read/org.switchyard.admin:name=%22_OrderService_soap_1%22,service=%22%7Burn:switchyard-quickstart:bean-service:0.1.0%7DOrderService%22,type=Binding

// This will bring back a response that includes the desired metrics:

{"request":{"mbean":"org.switchyard.admin:name=\"_OrderService_soap_1\",service=\"{urn:switchyard-quickstart:bean-service:0.1.0}OrderService\",type=Binding","type":"read"},"value":{"Type":"soap","TotalCount":4,"Configuration":"<binding.soap xmlns=\"urn:switchyard-component-soap:config:1.0\">\n wsdl\/OrderService.wsdl<\/wsdl>\n :${jettyPort}<\/socketAddr>\n quickstart-bean<\/contextPath>\n<\/binding.soap>","State":"STARTED","TotalProcessingTime":47,"FaultCount":0,"MinProcessingTime":6,"AverageProcessingTime":11.75,"SuccessCount":4,"Name":"_OrderService_soap_1","MaxProcessingTime":25},"timestamp":1497640978,"status":200}

// An Operation can be invoked using the 'exec' argument:

curl -u rick:MyPasswordHere http://localhost:8080/hawtio/jolokia/exec/org.switchyard.admin:name=%22_OrderService_soap_1%22,service=%22%7Burn:switchyard-quickstart:bean-service:0.1.0%7DOrderService%22,type=Binding/reset


This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.