Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.72 KB

README.adoc

File metadata and controls

67 lines (47 loc) · 2.72 KB

Java EE actuator

This is a library and a web application that showcases exposing resources such as CPU, heap memory usage, CDI beans, etc. as a RESTful resource. It is inspired by Spring Boot Actuator.

Running the showcase app

You can either deploy the showcase web application into TomEE 7.0.1 server, or you can run it directly using the TomEE Maven plugin

Deployment in TomEE server

  • Download and extract Apache TomEE 7.0.1 Plume

  • Build this project

  • Configure the JMX server by running this command in the console.

# For Windows
set CATALINA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11223 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

# For Linux
export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11223 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
  • Start TomEE application server in the same console

  • Deploy the war from the javaee-actuator-showcase/target directory

  • The actuator endpoints should be available at http://localhost:8080/actuator/actuator

Running with the TomEE Maven plugin

  • Build this project

  • Change to the javaee-actuator-showcase directory

  • Configure the JMX server by running this command in the console.

# For Windows
set CATALINA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11223 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

# For Linux
export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11223 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

Available endpoints

Endpoint Description

/metrics

Provides useful metrics such as CPU, Heap Memory usage, etc.

/beans

Lists the CDI beans loaded by the BeanManager

/beans?package=<some-package-name>

Shows only beans that belong to the given package. Usefull when you want to filter out beans that come with the server and show only the ones coming with the application.

/dump

Dumps the running threads of the application