2.60. Jolokia


Expose runtime metrics and management operations via JMX with Jolokia

2.60.1. Maven coordinates

Create a new project with this extension on code.camel.redhat.com

Or add the coordinates to your existing project:

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

2.60.2. Usage

This extension adds Jolokia support to your application.

2.60.2.1. Jolokia HTTP endpoints

In prod mode, Jolokia is accessible at the following URLs.

In dev and test modes Jolokia is bound only to localhost.

To disable exposing Jolokia via the Quarkus management interface at /q/jolokia, add the following configuration to application.properties.

quarkus.camel.jolokia.register-management-endpoint=false

If you want to disable Jolokia entirely, then add the following configuration to application.properties.

quarkus.camel.jolokia.enabled=false

2.60.2.2. Jolokia configuration

Any of the Jolokia configuration options can be configured via the quarkus.camel.jolokia.additional-properties.<jolokia-property-name> option. Where <jolokia-property-name> is the name of the Jolokia configuration option you want to set.

For example, the following configuration added to application.properties enables Jolokia debugging and sets the max depth for traversing bean properties.

quarkus.camel.jolokia.additional-properties.debug=true
quarkus.camel.jolokia.additional-properties.maxDepth=10

2.60.2.3. Jolokia restrictor

By default, a Jolokia restrictor is automatically registered that exposes access to only a specific set of MBean domains.

  • org.apache.camel
  • java.lang
  • java.nio

If this is too restrictive, then you can either specify your own MBean domains, disable the default restrictor, or create a custom restrictor.

2.60.2.3.1. Default restrictor MBean domains

You can modify the set of MBean domains referenced by the default restrictor by adding configuration like the following to application.properties.

quarkus.camel.jolokia.camel-restrictor-allowed-mbean-domains=org.apache.camel
2.60.2.3.2. Disabling the default restrictor

The following configuration added to application.properties disables the default restrictor.

quarkus.camel.jolokia.register-camel-restrictor=false
2.60.2.3.3. Create a custom restrictor

You can create your own restrictor class and register it with Jolokia.

public class CustomRestrictor extends AllowAllRestrictor {
    // Override methods to apply custom restrictions
}

Register the restrictor with Jolokia by adding the following configuration to application.properties.

quarkus.camel.jolokia.additional-properties.restrictorClass=org.acme.CustomRestrictor

2.60.2.4. Kubernetes & OpenShift support

2.60.2.4.1. Generated Kubernetes manifests

If the quarkus-kubernetes or quarkus-openshift extensions are present, a container port named jolokia will be added automatically to the pod configuration within the generated Kubernetes manifest resources.

This can be disabled by adding the following configuration to application.properties.

quarkus.camel.jolokia.kubernetes.expose-container-port=false
2.60.2.4.2. Automatic enablement of SSL client authentication

If the application detects that it is running on Kubernetes or OpenShift, then Jolokia is automatically configured for SSL client authentication. This is useful if you use tools like Hawtio to discover and connect to your running application pod.

This functionality can be disabled by adding the following configuration to application.properties.

quarkus.camel.jolokia.kubernetes.client-authentication-enabled=false

Note that if you choose to use hawtio-online to connect to your running application, then you must configure the Jolokia client principal.

quarkus.camel.jolokia.kubernetes.client-principal=cn=hawtio-online.hawtio.svc

2.60.3. Camel Quarkus limitations

2.60.3.1. Native mode limitations

JMX in GraalVM is still experimental. Therefore, some features are not available in native mode.

Refer to the Camel Quarkus Management extension limitations section for more details.

2.60.4. Additional Camel Quarkus configuration

Expand
Configuration propertyTypeDefault

lock quarkus.camel.jolokia.enabled

Enables Jolokia support.

boolean

true

lock quarkus.camel.jolokia.path

The context path that the Jolokia agent is deployed under.

string

jolokia

lock quarkus.camel.jolokia.register-management-endpoint

Whether to register a Quarkus management endpoint for Jolokia (default /q/jolokia). When enabled this activates a management endpoint which will be accessible on a path relative to ${quarkus.http.non-application-root-path}/${quarkus.camel.jolokia.server.path}. If the management interface is enabled, the value will be resolved as a path relative to ${quarkus.management.root-path}/${quarkus.camel.jolokia.server.path}. Note that for this feature to work you must have quarkus-vertx-http on the application classpath.

boolean

true

lock quarkus.camel.jolokia.camel-restrictor-allowed-mbean-domains

Comma separated list of allowed MBean domains used by CamelJolokiaRestrictor.

List of string

org.apache.camel,java.lang,java.nio

lock quarkus.camel.jolokia.kubernetes.expose-container-port

When {@code true} and the quarkus-kubernetes extension is present, a container port named jolokia will be added to the generated Kubernetes manifests within the container spec ports definition.

boolean

true

quarkus.camel.jolokia.server.auto-start

Whether the Jolokia agent HTTP server should be started automatically. When set to false, it is the user responsibility to start the server. This can be done via @Inject CamelQuarkusJolokiaServer and then invoking the start() method.

boolean

true

quarkus.camel.jolokia.server.host

The host address to which the Jolokia agent HTTP server should bind to. When unspecified, the default is localhost for dev and test mode. In prod mode the default is to bind to all interfaces at 0.0.0.0.

string

 

quarkus.camel.jolokia.server.port

The port the Jolokia agent HTTP server listens to.

int

8778

quarkus.camel.jolokia.server.discovery-enabled-mode

The mode in which Jolokia agent discovery is enabled. The default dev-test, enables discovery only in dev and test modes. A value of all enables agent discovery in dev, test and prod modes. Setting the value to none will disable agent discovery in all modes.

all, dev-test, none

dev-test

quarkus.camel.jolokia.kubernetes.client-authentication-enabled

Whether to enable Jolokia SSL client authentication in Kubernetes environments. Useful for tools such as hawtio to be able to connect with your application.

boolean

true

quarkus.camel.jolokia.kubernetes.service-ca-cert

Absolute path of the CA certificate Jolokia should use for SSL client authentication.

File

/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt

quarkus.camel.jolokia.kubernetes.client-principal

The principal which must be given in a client certificate to allow access to Jolokia.

string

 

quarkus.camel.jolokia.additional-properties."additional-properties"

Arbitrary Jolokia configuration options. These are described at the Jolokia documentation. Options can be configured like quarkus.camel.jolokia.additional-properties."debug"=true.

Map<String,String>

 

quarkus.camel.jolokia.register-camel-restrictor

When true, a Jolokia restrictor is registered that limits MBean read, write and operation execution to the following MBean domains.

  • org.apache.camel
  • java.lang
  • java.nio

Note that this option has no effect if quarkus.camel.jolokia.additional-properties."restrictorClass" is set.

boolean

true

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

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る