Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 17. Control Bus


Manage and monitor Camel routes.

17.1. What’s inside

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

17.2. Maven coordinates

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

Or add the coordinates to your existing project:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-controlbus</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

17.3. Usage

17.3.1. Statistics

When using the stats command endpoint, the camel-quarkus-management extension must be added as a project dependency to enable JMX. Maven users will have to add the following to their pom.xml:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-management</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

17.3.2. Languages

The following languages are supported for use in the Control Bus extension in Camel Extensions for Quarkus:

17.3.2.1. Bean

The Bean language can be used to invoke a method on a bean to control the state of routes. The org.apache.camel.quarkus:camel-quarkus-bean extension must be added to the classpath. Maven users must add the following dependency to the POM:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-bean</artifactId>
</dependency>
Copy to Clipboard Toggle word wrap

In native mode, the bean class must be annotated with @RegisterForReflection.

17.3.2.2. Simple

The Simple language can be used to control the state of routes. The following example uses a ProducerTemplate to stop a route with the id foo:

template.sendBody(
    "controlbus:language:simple",
    "${camelContext.getRouteController().stopRoute('foo')}"
);
Copy to Clipboard Toggle word wrap

To use the OGNL notation, the org.apache.camel.quarkus:camel-quarkus-bean extension must be added as a dependency.

In native mode, the classes used in the OGNL notation must be registered for reflection. In the above code snippet, the org.apache.camel.spi.RouteController class returned from camelContext.getRouteController() must be registered. As this is a third-party class, it cannot be annotated with @RegisterForReflection directly - instead you can annotate a different class and specifying the target classes to register. For example, the class defining the Camel routes could be annotated with @RegisterForReflection(targets = { org.apache.camel.spi.RouteController.class }).

Alternatively, add the following line to your src/main/resources/application.properties:

quarkus.camel.native.reflection.include-patterns = org.apache.camel.spi.RouteController
Copy to Clipboard Toggle word wrap

17.4. Camel Quarkus limitations

17.4.1. Statistics

The stats action is not available in native mode as JMX is not supported on GraalVM. Therefore, attempting to build a native image with the camel-quarkus-management extension on the classpath will result in a build failure.

This feature is not supported in Camel Extensions for Quarkus.

Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat