You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2020/09/08 16:47:47 UTC
[camel-quarkus] branch master updated: Management JVM support
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new 9ca7790 Management JVM support
9ca7790 is described below
commit 9ca7790efca888ac31cd37c083897fd7105a8c0f
Author: James Netherton <ja...@gmail.com>
AuthorDate: Tue Sep 8 15:49:34 2020 +0100
Management JVM support
Fixes #1564
---
catalog/pom.xml | 13 +++
docs/modules/ROOT/nav.adoc | 1 +
.../pages/reference/extensions/management.adoc | 29 ++++++
docs/modules/ROOT/pages/reference/index.adoc | 3 +
docs/modules/ROOT/pages/reference/others.adoc | 3 +
extensions-jvm/management/deployment/pom.xml | 67 +++++++++++++
.../management/deployment/ManagementProcessor.java | 47 +++++++++
extensions-jvm/management/integration-test/pom.xml | 108 +++++++++++++++++++++
.../quarkus/component/management/it/Routes.java | 26 +++++
.../component/management/it/ManagementTest.java | 46 +++++++++
extensions-jvm/management/pom.xml | 40 ++++++++
extensions-jvm/management/runtime/pom.xml | 98 +++++++++++++++++++
.../runtime/src/main/doc/limitations.adoc | 2 +
.../management/CamelManagementRecorder.java | 38 ++++++++
.../main/resources/META-INF/quarkus-extension.yaml | 32 ++++++
extensions-jvm/pom.xml | 1 +
poms/bom/pom.xml | 15 +++
17 files changed, 569 insertions(+)
diff --git a/catalog/pom.xml b/catalog/pom.xml
index 4cd5d61..0ab48ae 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -2207,6 +2207,19 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-master</artifactId>
<version>${project.version}</version>
<type>pom</type>
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 7d74778..cb98401 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -179,6 +179,7 @@
*** xref:reference/extensions/lumberjack.adoc[Lumberjack]
*** xref:reference/extensions/lzf.adoc[LZF Deflate Compression]
*** xref:reference/extensions/main.adoc[Main]
+*** xref:reference/extensions/management.adoc[Management]
*** xref:reference/extensions/master.adoc[Master]
*** xref:reference/extensions/microprofile-fault-tolerance.adoc[Microprofile Fault Tolerance]
*** xref:reference/extensions/microprofile-health.adoc[Microprofile Health]
diff --git a/docs/modules/ROOT/pages/reference/extensions/management.adoc b/docs/modules/ROOT/pages/reference/extensions/management.adoc
new file mode 100644
index 0000000..2a59f80
--- /dev/null
+++ b/docs/modules/ROOT/pages/reference/extensions/management.adoc
@@ -0,0 +1,29 @@
+// Do not edit directly!
+// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
+
+[[management]]
+= Management
+:page-aliases: extensions/management.adoc
+
+[.badges]
+[.badge-key]##Since Camel Quarkus##[.badge-version]##1.1.0## [.badge-key]##JVM##[.badge-supported]##supported## [.badge-key]##Native##[.badge-unsupported]##unsupported##
+
+JMX management strategy and associated managed resources.
+
+== Maven coordinates
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management</artifactId>
+</dependency>
+----
+
+Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
+
+== Camel Quarkus limitations
+
+The JMX management beans exposed by this extension will not work in native mode, as GraalVM has no support for JMX. Therefore, attempting to build a native
+image with this extension on the classpath will result in a build failure.
+
diff --git a/docs/modules/ROOT/pages/reference/index.adoc b/docs/modules/ROOT/pages/reference/index.adoc
index 702647f..993fe05 100644
--- a/docs/modules/ROOT/pages/reference/index.adoc
+++ b/docs/modules/ROOT/pages/reference/index.adoc
@@ -515,6 +515,9 @@ Stable | 1.0.0 | Compress and decompress streams using LZF deflate algorithm.
| xref:reference/extensions/main.adoc[Main] | camel-quarkus-main | [.camel-element-Native]##Native## +
Stable | 1.0.0 | Bootstrap Camel using Camel Main which brings advanced auto-configuration capabilities and integration with Quarkus Command Mode
+| xref:reference/extensions/management.adoc[Management] | camel-quarkus-management | [.camel-element-JVM]##JVM## +
+Preview | 1.1.0 | JMX management strategy and associated managed resources.
+
| xref:reference/extensions/master.adoc[Master] | camel-quarkus-master | [.camel-element-Native]##Native## +
Stable | 1.1.0 | Have only a single consumer in a cluster consuming from a given endpoint; with automatic failover if the JVM dies.
diff --git a/docs/modules/ROOT/pages/reference/others.adoc b/docs/modules/ROOT/pages/reference/others.adoc
index 57a79bf..d2a1385 100644
--- a/docs/modules/ROOT/pages/reference/others.adoc
+++ b/docs/modules/ROOT/pages/reference/others.adoc
@@ -37,6 +37,9 @@ Stable | 1.0.0 | Write Camel integration routes in Kotlin
| xref:reference/extensions/main.adoc[Main] | [.camel-element-artifact]##camel-quarkus-main## | [.camel-element-Native]##Native## +
Stable | 1.0.0 | Bootstrap Camel using Camel Main which brings advanced auto-configuration capabilities and integration with Quarkus Command Mode
+| xref:reference/extensions/management.adoc[Management] | [.camel-element-artifact]##camel-quarkus-management## | [.camel-element-JVM]##JVM## +
+Preview | 1.1.0 | JMX management strategy and associated managed resources.
+
| xref:reference/extensions/microprofile-fault-tolerance.adoc[Microprofile Fault Tolerance] | [.camel-element-artifact]##camel-quarkus-microprofile-fault-tolerance## | [.camel-element-Native]##Native## +
Stable | 1.0.0 | Circuit Breaker EIP using MicroProfile Fault Tolerance
diff --git a/extensions-jvm/management/deployment/pom.xml b/extensions-jvm/management/deployment/pom.xml
new file mode 100644
index 0000000..8516f99
--- /dev/null
+++ b/extensions-jvm/management/deployment/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-management-deployment</artifactId>
+ <name>Camel Quarkus :: Management :: Deployment</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-xml-jaxb-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/extensions-jvm/management/deployment/src/main/java/org/apache/camel/quarkus/component/management/deployment/ManagementProcessor.java b/extensions-jvm/management/deployment/src/main/java/org/apache/camel/quarkus/component/management/deployment/ManagementProcessor.java
new file mode 100644
index 0000000..859f09c
--- /dev/null
+++ b/extensions-jvm/management/deployment/src/main/java/org/apache/camel/quarkus/component/management/deployment/ManagementProcessor.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.management.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.annotations.ExecutionTime;
+import io.quarkus.deployment.annotations.Record;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.pkg.steps.NativeBuild;
+import org.apache.camel.quarkus.component.management.CamelManagementRecorder;
+import org.apache.camel.quarkus.core.deployment.spi.RuntimeCamelContextCustomizerBuildItem;
+
+class ManagementProcessor {
+
+ private static final String FEATURE = "camel-management";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @Record(ExecutionTime.RUNTIME_INIT)
+ @BuildStep
+ RuntimeCamelContextCustomizerBuildItem configureCamelContext(CamelManagementRecorder recorder) {
+ return new RuntimeCamelContextCustomizerBuildItem(recorder.createContextCustomizer());
+ }
+
+ @BuildStep(onlyIf = NativeBuild.class)
+ void nativeUnsupported() {
+ throw new RuntimeException("The " + FEATURE + " extension is not supported in native mode "
+ + "as JMX is not supported on GraalVM");
+ }
+}
diff --git a/extensions-jvm/management/integration-test/pom.xml b/extensions-jvm/management/integration-test/pom.xml
new file mode 100644
index 0000000..52be5be
--- /dev/null
+++ b/extensions-jvm/management/integration-test/pom.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-management-integration-test</artifactId>
+ <name>Camel Quarkus :: Management :: Integration Test</name>
+ <description>Integration tests for Camel Quarkus Management extension</description>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom-test</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/extensions-jvm/management/integration-test/src/main/java/org/apache/camel/quarkus/component/management/it/Routes.java b/extensions-jvm/management/integration-test/src/main/java/org/apache/camel/quarkus/component/management/it/Routes.java
new file mode 100644
index 0000000..e411a5a
--- /dev/null
+++ b/extensions-jvm/management/integration-test/src/main/java/org/apache/camel/quarkus/component/management/it/Routes.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.management.it;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class Routes extends RouteBuilder {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").setBody().constant("Hello World");
+ }
+}
diff --git a/extensions-jvm/management/integration-test/src/test/java/org/apache/camel/quarkus/component/management/it/ManagementTest.java b/extensions-jvm/management/integration-test/src/test/java/org/apache/camel/quarkus/component/management/it/ManagementTest.java
new file mode 100644
index 0000000..70a1d2c
--- /dev/null
+++ b/extensions-jvm/management/integration-test/src/test/java/org/apache/camel/quarkus/component/management/it/ManagementTest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.management.it;
+
+import java.lang.management.ManagementFactory;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@QuarkusTest
+class ManagementTest {
+
+ @Test
+ public void testCamelManagement() throws Exception {
+ MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+ ObjectName objectName = new ObjectName("org.apache.camel:type=context,*");
+ Set<ObjectInstance> mbeans = server.queryMBeans(objectName, null);
+ assertEquals(1, mbeans.size());
+
+ ObjectInstance instance = mbeans.iterator().next();
+ String routeXML = (String) server.invoke(instance.getObjectName(), "dumpRoutesAsXml", new Object[] {}, new String[] {});
+ assertTrue(routeXML.contains("<from uri=\"direct:start\"/>"));
+ }
+}
diff --git a/extensions-jvm/management/pom.xml b/extensions-jvm/management/pom.xml
new file mode 100644
index 0000000..60d5e28
--- /dev/null
+++ b/extensions-jvm/management/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-management-parent</artifactId>
+ <name>Camel Quarkus :: Management</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>deployment</module>
+ <module>runtime</module>
+ <module>integration-test</module>
+ </modules>
+</project>
diff --git a/extensions-jvm/management/runtime/pom.xml b/extensions-jvm/management/runtime/pom.xml
new file mode 100644
index 0000000..fdbcd68
--- /dev/null
+++ b/extensions-jvm/management/runtime/pom.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management-parent</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-management</artifactId>
+ <name>Camel Quarkus :: Management :: Runtime</name>
+ <description>JMX management strategy and associated managed resources.</description>
+
+ <properties>
+ <firstVersion>1.1.0</firstVersion>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-xml-jaxb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-management</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>update-extension-doc-page</id>
+ <goals><goal>update-extension-doc-page</goal></goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/extensions-jvm/management/runtime/src/main/doc/limitations.adoc b/extensions-jvm/management/runtime/src/main/doc/limitations.adoc
new file mode 100644
index 0000000..9bb2269
--- /dev/null
+++ b/extensions-jvm/management/runtime/src/main/doc/limitations.adoc
@@ -0,0 +1,2 @@
+The JMX management beans exposed by this extension will not work in native mode, as GraalVM has no support for JMX. Therefore, attempting to build a native
+image with this extension on the classpath will result in a build failure.
diff --git a/extensions-jvm/management/runtime/src/main/java/org/apache/camel/quarkus/component/management/CamelManagementRecorder.java b/extensions-jvm/management/runtime/src/main/java/org/apache/camel/quarkus/component/management/CamelManagementRecorder.java
new file mode 100644
index 0000000..ddd018b
--- /dev/null
+++ b/extensions-jvm/management/runtime/src/main/java/org/apache/camel/quarkus/component/management/CamelManagementRecorder.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.management;
+
+import io.quarkus.runtime.RuntimeValue;
+import io.quarkus.runtime.annotations.Recorder;
+import org.apache.camel.CamelContext;
+import org.apache.camel.quarkus.core.CamelContextCustomizer;
+
+@Recorder
+public class CamelManagementRecorder {
+
+ public RuntimeValue<CamelContextCustomizer> createContextCustomizer() {
+ return new RuntimeValue<>(new CamelManagementCustomizer());
+ }
+
+ private static final class CamelManagementCustomizer implements CamelContextCustomizer {
+
+ @Override
+ public void customize(CamelContext context) {
+ context.setManagementName(context.getName());
+ }
+ }
+}
diff --git a/extensions-jvm/management/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions-jvm/management/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..855e756
--- /dev/null
+++ b/extensions-jvm/management/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,32 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# This is a generated file. Do not edit directly!
+# To re-generate, run the following command from the top level directory:
+#
+# mvn -N cq:update-quarkus-metadata
+#
+---
+name: "Camel Management"
+description: "JMX management strategy and associated managed resources"
+metadata:
+ unlisted: true
+ guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/management.html"
+ categories:
+ - "integration"
+ status:
+ - "preview"
diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml
index bd47c73..8a1992f 100644
--- a/extensions-jvm/pom.xml
+++ b/extensions-jvm/pom.xml
@@ -97,6 +97,7 @@
<module>ldif</module>
<module>lucene</module>
<module>lumberjack</module>
+ <module>management</module>
<module>milo</module>
<module>mllp</module>
<module>msv</module>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index b79b9fc..2a5f8b4 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -1206,6 +1206,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-management</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-master</artifactId>
<version>${camel.version}</version>
</dependency>
@@ -3507,6 +3512,16 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-management-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-master</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>