This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-examples.git
commit cacf35049e6402e523cc363b9f3e217f486fb121 Author: Claus Ibsen <[email protected]> AuthorDate: Wed Oct 30 11:06:26 2024 +0100 Remove example that is not for the future --- pom.xml | 1 - reactive-executor-vertx/README.adoc | 35 ------- reactive-executor-vertx/pom.xml | 106 --------------------- .../org/apache/camel/example/MyApplication.java | 61 ------------ .../org/apache/camel/example/MyRouteBuilder.java | 31 ------ .../src/main/resources/application.properties | 27 ------ .../src/main/resources/log4j2.properties | 23 ----- .../java/org/apache/camel/example/VertxTest.java | 61 ------------ 8 files changed, 345 deletions(-) diff --git a/pom.xml b/pom.xml index b3bebc3f..e0b921a1 100644 --- a/pom.xml +++ b/pom.xml @@ -124,7 +124,6 @@ <module>mongodb</module> <module>netty-custom-correlation</module> <module>oaipmh</module> - <module>reactive-executor-vertx</module> <module>resume-api</module> <module>routeloader</module> <module>routetemplate</module> diff --git a/reactive-executor-vertx/README.adoc b/reactive-executor-vertx/README.adoc deleted file mode 100644 index 0a2f06d6..00000000 --- a/reactive-executor-vertx/README.adoc +++ /dev/null @@ -1,35 +0,0 @@ -== Camel Example Reactive Executor VertX - -This example uses VertX as the reactive executor for routing messages with Camel. -By default, Camel uses its own reactive engine for routing messages, but you can plug in -different engines via a SPI interface. This example uses VertX as the engine. - -=== Build - -You will need to compile this example first: - ----- -$ mvn compile ----- - -=== How to run - -You can run this example using - ----- -$ mvn camel:run ----- - -=== More information - -You can find more information about Apache Camel at the website: http://camel.apache.org/ - -=== Help and contributions - -If you hit any problem using Camel or have some feedback, then please -https://camel.apache.org/community/support/[let us know]. - -We also love contributors, so -https://camel.apache.org/community/contributing/[get involved] :-) - -The Camel riders! diff --git a/reactive-executor-vertx/pom.xml b/reactive-executor-vertx/pom.xml deleted file mode 100644 index 504ef5cb..00000000 --- a/reactive-executor-vertx/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ -<?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/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.camel.example</groupId> - <artifactId>camel-examples</artifactId> - <version>4.9.0-SNAPSHOT</version> - </parent> - - <artifactId>camel-example-reactive-executor-vertx</artifactId> - <packaging>jar</packaging> - <name>Camel :: Example :: Reactive Executor :: VertX</name> - <description>An example for showing using VertX as reactive executor with standalone Camel</description> - - <properties> - <category>Reactive</category> - </properties> - - <dependencyManagement> - <dependencies> - <!-- Add Camel BOM --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-bom</artifactId> - <version>${camel.version}</version> - <type>pom</type> - <scope>import</scope> - </dependency> - </dependencies> - </dependencyManagement> - - <dependencies> - - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-main</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-reactive-executor-vertx</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-threadpoolfactory-vertx</artifactId> - </dependency> - - <!-- logging --> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${log4j2-version}</version> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j2-impl</artifactId> - <version>${log4j2-version}</version> - <scope>runtime</scope> - </dependency> - <!-- for testing --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test-main-junit5</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <!-- Allows the example to be run via 'mvn camel:run' --> - <plugin> - <groupId>org.apache.camel</groupId> - <artifactId>camel-maven-plugin</artifactId> - <version>${camel.version}</version> - <configuration> - <mainClass>org.apache.camel.example.MyApplication</mainClass> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/reactive-executor-vertx/src/main/java/org/apache/camel/example/MyApplication.java b/reactive-executor-vertx/src/main/java/org/apache/camel/example/MyApplication.java deleted file mode 100644 index 4a564fc3..00000000 --- a/reactive-executor-vertx/src/main/java/org/apache/camel/example/MyApplication.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.example; - -import io.vertx.core.Vertx; -import org.apache.camel.BindToRegistry; -import org.apache.camel.CamelContext; -import org.apache.camel.Configuration; -import org.apache.camel.main.Main; -import org.apache.camel.support.LifecycleStrategySupport; - -/** - * Main class that boot the Camel application - */ -public final class MyApplication { - - private MyApplication() { - } - - public static void main(String[] args) throws Exception { - // use Camels Main class - Main main = new Main(MyApplication.class); - // now keep the application running until the JVM is terminated (ctrl + c or sigterm) - main.run(args); - } - - @Configuration - static class MyConfiguration { - - @BindToRegistry(value = "vertx", beanPostProcess = true) - public Vertx vertx(CamelContext camelContext) { - // register existing vertx which should be used by Camel - final Vertx vertx = Vertx.vertx(); - // register 'vertx' bean stop lifecycle hook - camelContext.addLifecycleStrategy(new LifecycleStrategySupport() { - @Override - public void onContextStopped(CamelContext context) { - super.onContextStopped(context); - // stop vertx - vertx.close(); - } - }); - return vertx; - } - } - -} diff --git a/reactive-executor-vertx/src/main/java/org/apache/camel/example/MyRouteBuilder.java b/reactive-executor-vertx/src/main/java/org/apache/camel/example/MyRouteBuilder.java deleted file mode 100644 index 91acfebc..00000000 --- a/reactive-executor-vertx/src/main/java/org/apache/camel/example/MyRouteBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.example; - -import org.apache.camel.builder.RouteBuilder; - -public class MyRouteBuilder extends RouteBuilder { - - @Override - public void configure() throws Exception { - from("timer:foo?period=5s") - .setBody().constant("H,e,l,l,o, ,W,o,r,l,d,!,!,!, , ") - .split(body().tokenize(",")).parallelProcessing() - .log("${body}") - .end(); - } -} diff --git a/reactive-executor-vertx/src/main/resources/application.properties b/reactive-executor-vertx/src/main/resources/application.properties deleted file mode 100644 index 1d6d98b6..00000000 --- a/reactive-executor-vertx/src/main/resources/application.properties +++ /dev/null @@ -1,27 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- - -# here you can configure options on camel main -# https://camel.apache.org/components/next/others/main.html -camel.main.name = MyVertXCamel - -# you can also configure camel context directly -# camel.context.shutdown-strategy.shutdown-now-on-timeout = false - -# application properties -hi = Hello - diff --git a/reactive-executor-vertx/src/main/resources/log4j2.properties b/reactive-executor-vertx/src/main/resources/log4j2.properties deleted file mode 100644 index d406a9f6..00000000 --- a/reactive-executor-vertx/src/main/resources/log4j2.properties +++ /dev/null @@ -1,23 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- - -appender.out.type = Console -appender.out.name = out -appender.out.layout.type = PatternLayout -appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n -rootLogger.level = INFO -rootLogger.appenderRef.out.ref = out diff --git a/reactive-executor-vertx/src/test/java/org/apache/camel/example/VertxTest.java b/reactive-executor-vertx/src/test/java/org/apache/camel/example/VertxTest.java deleted file mode 100644 index d90747c1..00000000 --- a/reactive-executor-vertx/src/test/java/org/apache/camel/example/VertxTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.example; - -import java.util.concurrent.TimeUnit; - -import io.vertx.core.Vertx; -import org.apache.camel.builder.NotifyBuilder; -import org.apache.camel.main.MainConfigurationProperties; -import org.apache.camel.spi.Registry; -import org.apache.camel.test.main.junit5.CamelMainTestSupport; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -/** - * A unit test checking that Camel can use VertX as reactive executor. - */ -class VertxTest extends CamelMainTestSupport { - - @AfterEach - void destroy() { - Vertx vertx = context.getRegistry().lookupByNameAndType("vertx", Vertx.class); - if (vertx != null) { - vertx.close(); - } - } - - @Override - protected void bindToRegistry(Registry registry) throws Exception { - registry.bind("vertx", Vertx.vertx()); - } - - @Test - void should_use_vertx_as_reactive_executor() { - NotifyBuilder notify = new NotifyBuilder(context).from("timer:*").whenCompleted(15).create(); - assertTrue( - notify.matches(30, TimeUnit.SECONDS), "15 messages should be completed" - ); - } - - @Override - protected void configure(MainConfigurationProperties configuration) { - configuration.addRoutesBuilder(MyRouteBuilder.class); - } -}
