Jfr

JVM since1.7.0 Native since2.6.0

Diagnose Camel applications with Java Flight Recorder

What’s inside

Please refer to the above link for usage and configuration details.

Maven coordinates

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jfr</artifactId>
</dependency>

Check the User guide for more information about writing Camel Quarkus applications.

Usage

Starting flight recording

To enable Java Flight Recorder to start a recording and automatically dump the recording to disk after Camel startup is complete, use the following configuration in application.properties.

quarkus.camel.jfr.startup-recorder-recording=true

Alternatively you can pass some Java options to the runnable application JAR or the native executable to enable flight recording at application startup.

In JVM mode the application runnable JAR can be executed as follows.

$ java -XX:+FlightRecorder -XX:StartFlightRecording=filename=recording.jfr -jar quarkus-run.jar

In native mode, the native executable can be executed as follows.

$ ./my-application-runner -XX:+FlightRecorder -XX:StartFlightRecording=filename=recording.jfr

Flight recording in native mode

To build a native image with Java Flight Recorder support, it is mandatory to enable VM inspection via the following configuration property in application.properties.

quarkus.native.enable-vm-inspection=true

Additional Camel Quarkus configuration

Configuration property Type Default

quarkus.camel.jfr.startup-recorder-dir

Directory to store the recording. By default the current directory will be used. Use false to turn off saving the recording to disk.

string

quarkus.camel.jfr.startup-recorder-duration

How long time to run the startup recorder. Use 0 (default) to keep the recorder running until the JVM is exited. Use -1 to stop the recorder right after Camel has been started (to only focus on potential Camel startup performance bottlenecks) Use a positive value to keep recording for N seconds. When the recorder is stopped then the recording is auto saved to disk (note: save to disk can be disabled by setting startupRecorderDir to false).

java.lang.Long

quarkus.camel.jfr.startup-recorder-max-depth

To filter our sub steps at a maximum depth. Use -1 for no maximum. Use 0 for no sub steps. Use 1 for max 1 sub step, and so forth. The default is -1.

java.lang.Integer

quarkus.camel.jfr.startup-recorder-profile

To use a specific Java Flight Recorder profile configuration, such as default or profile. The default is default.

string

quarkus.camel.jfr.startup-recorder-recording

To enable Java Flight Recorder to start a recording and automatic dump the recording to disk after startup is complete. This requires that camel-jfr is on the classpath. The default is false.

java.lang.Boolean

Configuration property fixed at build time. All other configuration properties are overridable at runtime.