You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/11/08 14:40:35 UTC
[camel-quarkus] branch master updated: feat: controlbus extension.
(#388)
This is an automated email from the ASF dual-hosted git repository.
davsclaus 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 396e008 feat: controlbus extension. (#388)
396e008 is described below
commit 396e008a9549b07cbea0835d655e2324aecf5d1a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Nov 8 15:40:29 2019 +0100
feat: controlbus extension. (#388)
* feat: controlbus extension.
* feat: controlbus extension.
* Argh please keep those pom.xml ordered a..z
* Fixed pom.xml
* Update test thanks to Peter for the suggestion
---
.../pages/list-of-camel-quarkus-extensions.adoc | 5 +-
extensions/controlbus/deployment/pom.xml | 75 +++++++++++
.../controlbus/deployment/ControlbusProcessor.java | 31 +++++
extensions/controlbus/pom.xml | 39 ++++++
extensions/controlbus/runtime/pom.xml | 82 ++++++++++++
.../main/resources/META-INF/quarkus-extension.yaml | 10 ++
extensions/pom.xml | 1 +
extensions/readme.adoc | 5 +-
integration-tests/controlbus/pom.xml | 140 +++++++++++++++++++++
.../controlbus/it/ControlbusResource.java | 65 ++++++++++
.../component/controlbus/it/ControlbusRoute.java | 36 ++++++
.../component/controlbus/it/ControlbusIT.java | 24 ++++
.../component/controlbus/it/ControlbusTest.java | 42 +++++++
integration-tests/pom.xml | 1 +
pom.xml | 1 +
poms/bom-deployment/pom.xml | 5 +
poms/bom/pom.xml | 40 +++---
17 files changed, 585 insertions(+), 17 deletions(-)
diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
index a04a5fa..3fe5138 100644
--- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
+++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
@@ -6,7 +6,7 @@ As of Camel Quarkus {camel-quarkus-last-release} the following Camel artifacts a
== Camel Components
// components: START
-Number of Camel components: 27 in 23 JAR artifacts (0 deprecated)
+Number of Camel components: 28 in 24 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,5",options="header"]
|===
@@ -30,6 +30,9 @@ Number of Camel components: 27 in 23 JAR artifacts (0 deprecated)
| link:https://camel.apache.org/components/latest/class-component.html[Class] (camel-quarkus-bean) +
`class:beanName` | 0.2 | The class component is for invoking Java classes (Java beans) from Camel.
+| link:https://camel.apache.org/components/latest/controlbus-component.html[Control Bus] (camel-quarkus-controlbus) +
+`controlbus:command:language` | 0.4 | The controlbus component provides easy management of Camel applications based on the Control Bus EIP pattern.
+
| link:https://camel.apache.org/components/latest/direct-component.html[Direct] (camel-quarkus-direct) +
`direct:name` | 0.2 | The direct component provides direct, synchronous call to another endpoint from the same CamelContext.
diff --git a/extensions/controlbus/deployment/pom.xml b/extensions/controlbus/deployment/pom.xml
new file mode 100644
index 0000000..058e97d
--- /dev/null
+++ b/extensions/controlbus/deployment/pom.xml
@@ -0,0 +1,75 @@
+<?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-controlbus-parent</artifactId>
+ <version>0.3.2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-controlbus-deployment</artifactId>
+ <name>Camel Quarkus :: ControlBus :: Deployment</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom-deployment</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-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-controlbus</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/controlbus/deployment/src/main/java/org/apache/camel/quarkus/component/controlbus/deployment/ControlbusProcessor.java b/extensions/controlbus/deployment/src/main/java/org/apache/camel/quarkus/component/controlbus/deployment/ControlbusProcessor.java
new file mode 100644
index 0000000..01b09e6
--- /dev/null
+++ b/extensions/controlbus/deployment/src/main/java/org/apache/camel/quarkus/component/controlbus/deployment/ControlbusProcessor.java
@@ -0,0 +1,31 @@
+/*
+ * 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.controlbus.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+
+class ControlbusProcessor {
+
+ private static final String FEATURE = "camel-controlbus";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+}
diff --git a/extensions/controlbus/pom.xml b/extensions/controlbus/pom.xml
new file mode 100644
index 0000000..f0a24e3
--- /dev/null
+++ b/extensions/controlbus/pom.xml
@@ -0,0 +1,39 @@
+<?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>0.3.2-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-controlbus-parent</artifactId>
+ <name>Camel Quarkus :: ControlBus</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>runtime</module>
+ <module>deployment</module>
+ </modules>
+</project>
diff --git a/extensions/controlbus/runtime/pom.xml b/extensions/controlbus/runtime/pom.xml
new file mode 100644
index 0000000..7940db4
--- /dev/null
+++ b/extensions/controlbus/runtime/pom.xml
@@ -0,0 +1,82 @@
+<?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-controlbus-parent</artifactId>
+ <version>0.3.2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-controlbus</artifactId>
+ <name>Camel Quarkus :: ControlBus :: Runtime</name>
+
+ <properties>
+ <firstVersion>0.4.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</groupId>
+ <artifactId>camel-controlbus</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <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/controlbus/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/controlbus/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..0713db8
--- /dev/null
+++ b/extensions/controlbus/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,10 @@
+---
+name: "Camel Quarkus ControlBus"
+description: "Camel ControlBus support"
+metadata:
+ keywords:
+ - "camel"
+ - "monitoring"
+ guide: "https://quarkus.io/guides/camel"
+ categories:
+ - "integration"
\ No newline at end of file
diff --git a/extensions/pom.xml b/extensions/pom.xml
index c2c9a66..a5eaf39 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -74,6 +74,7 @@
<module>zipfile</module>
<module>attachments</module>
<module>pdf</module>
+ <module>controlbus</module>
</modules>
<build>
diff --git a/extensions/readme.adoc b/extensions/readme.adoc
index af2a488..abba2f4 100644
--- a/extensions/readme.adoc
+++ b/extensions/readme.adoc
@@ -5,7 +5,7 @@ Apache Camel Quarkus supports the following Camel artifacts as Quarkus Extension
== Camel Components
// components: START
-Number of Camel components: 27 in 23 JAR artifacts (0 deprecated)
+Number of Camel components: 28 in 24 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,5",options="header"]
|===
@@ -29,6 +29,9 @@ Number of Camel components: 27 in 23 JAR artifacts (0 deprecated)
| link:https://camel.apache.org/components/latest/class-component.html[Class] (camel-quarkus-bean) +
`class:beanName` | 0.2 | The class component is for invoking Java classes (Java beans) from Camel.
+| link:https://camel.apache.org/components/latest/controlbus-component.html[Control Bus] (camel-quarkus-controlbus) +
+`controlbus:command:language` | 0.4 | The controlbus component provides easy management of Camel applications based on the Control Bus EIP pattern.
+
| link:https://camel.apache.org/components/latest/direct-component.html[Direct] (camel-quarkus-direct) +
`direct:name` | 0.2 | The direct component provides direct, synchronous call to another endpoint from the same CamelContext.
diff --git a/integration-tests/controlbus/pom.xml b/integration-tests/controlbus/pom.xml
new file mode 100644
index 0000000..66cf10b
--- /dev/null
+++ b/integration-tests/controlbus/pom.xml
@@ -0,0 +1,140 @@
+<?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-integration-tests</artifactId>
+ <version>0.3.2-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-test-controlbus</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: ControlBus</name>
+ <description>Integration tests for Camel Quarkus ControlBus extension</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-controlbus</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </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>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>native-image</id>
+ <goals>
+ <goal>native-image</goal>
+ </goals>
+ <configuration>
+ <reportErrorsAtRuntime>false</reportErrorsAtRuntime>
+ <cleanupServer>true</cleanupServer>
+ <enableHttpsUrlHandler>true</enableHttpsUrlHandler>
+ <enableServer>false</enableServer>
+ <dumpProxies>false</dumpProxies>
+ <graalvmHome>${graalvmHome}</graalvmHome>
+ <enableJni>true</enableJni>
+ <enableAllSecurityServices>true</enableAllSecurityServices>
+ <disableReports>true</disableReports>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/integration-tests/controlbus/src/main/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusResource.java b/integration-tests/controlbus/src/main/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusResource.java
new file mode 100644
index 0000000..1f45b48
--- /dev/null
+++ b/integration-tests/controlbus/src/main/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusResource.java
@@ -0,0 +1,65 @@
+/*
+ * 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.controlbus.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.camel.ProducerTemplate;
+import org.jboss.logging.Logger;
+
+@Path("/controlbus")
+@ApplicationScoped
+public class ControlbusResource {
+
+ private static final Logger LOG = Logger.getLogger(ControlbusResource.class);
+
+ @Inject
+ ProducerTemplate producerTemplate;
+
+ @Path("/status")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String status() throws Exception {
+ final String message = producerTemplate.requestBody("direct:status", "", String.class);
+ LOG.infof("Received from controlbus: %s", message);
+ return message;
+ }
+
+ @Path("/start")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String start() throws Exception {
+ final String message = producerTemplate.requestBody("direct:start", "", String.class);
+ LOG.infof("Received from controlbus: %s", message);
+ return message;
+ }
+
+ @Path("/stop")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String stop() throws Exception {
+ final String message = producerTemplate.requestBody("direct:stop", "", String.class);
+ LOG.infof("Received from controlbus: %s", message);
+ return message;
+ }
+
+}
diff --git a/integration-tests/controlbus/src/main/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusRoute.java b/integration-tests/controlbus/src/main/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusRoute.java
new file mode 100644
index 0000000..4ae1f6b
--- /dev/null
+++ b/integration-tests/controlbus/src/main/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusRoute.java
@@ -0,0 +1,36 @@
+/*
+ * 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.controlbus.it;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class ControlbusRoute extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ from("timer:foo").routeId("foo").log("Foo route");
+
+ from("direct:status")
+ .transform().exchange(e -> e.getContext().getRouteController().getRouteStatus("foo").name());
+
+ from("direct:stop")
+ .to("controlbus:route?routeId=foo&action=stop");
+
+ from("direct:start")
+ .to("controlbus:route?routeId=foo&action=start");
+ }
+}
diff --git a/integration-tests/controlbus/src/test/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusIT.java b/integration-tests/controlbus/src/test/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusIT.java
new file mode 100644
index 0000000..24700f5
--- /dev/null
+++ b/integration-tests/controlbus/src/test/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusIT.java
@@ -0,0 +1,24 @@
+/*
+ * 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.controlbus.it;
+
+import io.quarkus.test.junit.NativeImageTest;
+
+@NativeImageTest
+class ControlbusIT extends ControlbusTest {
+
+}
diff --git a/integration-tests/controlbus/src/test/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusTest.java b/integration-tests/controlbus/src/test/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusTest.java
new file mode 100644
index 0000000..af190f3
--- /dev/null
+++ b/integration-tests/controlbus/src/test/java/org/apache/camel/quarkus/component/controlbus/it/ControlbusTest.java
@@ -0,0 +1,42 @@
+/*
+ * 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.controlbus.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+
+@QuarkusTest
+class ControlbusTest {
+
+ @Test
+ public void test() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT).get("/controlbus/status")
+ .then().body(org.hamcrest.CoreMatchers.equalTo("Started"));
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).get("/controlbus/stop")
+ .then().statusCode(200);
+
+ RestAssured.given()
+ .contentType(ContentType.TEXT).get("/controlbus/status")
+ .then().body(org.hamcrest.CoreMatchers.equalTo("Stopped"));
+ }
+
+}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index f865393..2f4cc76 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -103,6 +103,7 @@
<module>twitter</module>
<module>zipfile</module>
<module>pdf</module>
+ <module>controlbus</module>
</modules>
<build>
diff --git a/pom.xml b/pom.xml
index b7eae2d..e6fb889 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,6 +86,7 @@
camel-quarkus-core-deployment,camel-quarkus-servlet-deployment,camel-quarkus-rest-deployment,camel-quarkus-core-cloud-deployment -> camel-quarkus-integration-test-servlet
camel-quarkus-core-deployment,camel-quarkus-twitter-deployment,camel-quarkus-log-deployment -> camel-quarkus-integration-test-twitter
camel-quarkus-core-deployment,camel-quarkus-zipfile-deployment,camel-quarkus-direct-deployment,camel-quarkus-log-deployment -> camel-quarkus-integration-test-zipfile
+ camel-quarkus-core-deployment,camel-quarkus-controlbus-deployment,camel-quarkus-direct-deployment,camel-quarkus-timer-deployment,camel-quarkus-log-deployment -> camel-quarkus-integration-test-controlbus
</mvnd.builder.rules>
</properties>
diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml
index 8dce796..4470ecd 100644
--- a/poms/bom-deployment/pom.xml
+++ b/poms/bom-deployment/pom.xml
@@ -125,6 +125,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-controlbus-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-csv-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index f012301..785eeb4 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -106,6 +106,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-controlbus</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-core-engine</artifactId>
<version>${camel.version}</version>
</dependency>
@@ -335,6 +340,11 @@
<!-- Quarkus Camel (in alphabetical order) -->
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-attachments</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-aws-eks</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
@@ -360,6 +370,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-controlbus</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-csv</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
@@ -410,6 +425,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-netty</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-netty-http</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
@@ -425,6 +445,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-pdf</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-platform-http</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
@@ -511,25 +536,10 @@
<version>${xstream.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-attachments</artifactId>
- <version>${camel-quarkus.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-pdf</artifactId>
- <version>${camel-quarkus.version}</version>
- </dependency>
- <dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-netty</artifactId>
- <version>${camel-quarkus.version}</version>
- </dependency>
</dependencies>
</dependencyManagement>