Sunday 1 July 2012

Exposing monitoring by JMX in Spring application

To expose methods as MBeans in the Spring Application by JMX you have to:
  • Declare in the application configuration: <context:mbean-export/>
  • Annotate java class with @ManagedResource
  • Annotate getters or setters with <@ManagedAttribute>
After that you can connect by jconsole to your application and use annotated methods.
You can also use annotations: @ManagedOperation, @ManagedNotification for methods that are not setters or getters.

No comments: