You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/11/17 20:23:30 UTC

[camel-spring-boot-examples] branch main updated (b410b51 -> 92c49e1)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git.


    from b410b51  Fixing compilation error of class rest-jpa/src/main/java/org/apache/camel/example/spring/boot/rest/jpa/OrderService.java
     new 830ca16  Added a minimal Quartz Example
     new c185c22  Added Quartz Example to POM
     new 75ac455  Fixed Names
     new 92c49e1  Readme updated

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.adoc                                                  |  4 +++-
 pom.xml                                                      |  1 +
 {pojo => quartz}/README.adoc                                 |  7 ++-----
 {pojo => quartz}/pom.xml                                     | 12 ++++++++----
 .../src/main/java/sample/camel/Application.java              |  0
 .../src/main/java/sample/camel/QuartzRoute.java              | 11 +++++------
 {pojo => quartz}/src/main/resources/application.properties   |  2 +-
 7 files changed, 20 insertions(+), 17 deletions(-)
 copy {pojo => quartz}/README.adoc (58%)
 copy {pojo => quartz}/pom.xml (89%)
 copy {supervising-route-controller => quartz}/src/main/java/sample/camel/Application.java (100%)
 copy kamelet-chucknorris/src/main/java/sample/camel/MyRoute.java => quartz/src/main/java/sample/camel/QuartzRoute.java (84%)
 copy {pojo => quartz}/src/main/resources/application.properties (96%)

[camel-spring-boot-examples] 02/04: Added Quartz Example to POM

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git

commit c185c22634df804c0c9cd0f496ed39f0f88814cf
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 17 18:41:27 2021 +0100

    Added Quartz Example to POM
---
 pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pom.xml b/pom.xml
index 01d25a9..09e38a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,6 +84,7 @@
 		<module>xml-import</module>
 		<module>zipkin</module>
 		<module>strimzi</module>
+		<module>quartz</module>
 		<module>splitter-eip</module>
 		<module>widget-gadget</module>
 		<module>unit-testing</module>

[camel-spring-boot-examples] 01/04: Added a minimal Quartz Example

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git

commit 830ca16c30f2855b961ad529bb563ef698fe1846
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 17 18:40:15 2021 +0100

    Added a minimal Quartz Example
---
 quartz/README.adoc                                 |  29 ++++++
 quartz/pom.xml                                     | 116 +++++++++++++++++++++
 quartz/src/main/java/sample/camel/Application.java |  37 +++++++
 quartz/src/main/java/sample/camel/QuartzRoute.java |  32 ++++++
 quartz/src/main/resources/application.properties   |  25 +++++
 5 files changed, 239 insertions(+)

diff --git a/quartz/README.adoc b/quartz/README.adoc
new file mode 100644
index 0000000..b9b42bb
--- /dev/null
+++ b/quartz/README.adoc
@@ -0,0 +1,29 @@
+== Spring Boot Example with Quartz and Log
+
+=== Introduction
+
+This example demonstrates how to use Quartz Starter with Log Starter.
+
+=== Build
+
+You can build this example using:
+
+    $ mvn package
+
+=== Run
+
+You can run this example using:
+
+    $ mvn spring-boot:run
+
+And you should see output in the console with high and low numbers. The example will self stop after one minute.
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/quartz/pom.xml b/quartz/pom.xml
new file mode 100644
index 0000000..62e0141
--- /dev/null
+++ b/quartz/pom.xml
@@ -0,0 +1,116 @@
+<?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.springboot.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>3.13.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-spring-boot-pojo</artifactId>
+    <name>Camel SB Examples :: POJO Routing</name>
+    <description>An example showing how to work with Camel POJO routing with Spring Boot</description>
+
+    <properties>
+        <category>Beginner</category>
+
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <spring.boot-version>${spring-boot-version}</spring.boot-version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- Spring Boot BOM -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <!-- Camel BOM -->
+            <dependency>
+                <groupId>org.apache.camel.springboot</groupId>
+                <artifactId>camel-spring-boot-dependencies</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+
+        <!-- Spring Boot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- Camel -->
+        <dependency>
+            <groupId>org.apache.camel.springboot</groupId>
+            <artifactId>camel-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.springboot</groupId>
+            <artifactId>camel-quartz-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.springboot</groupId>
+            <artifactId>camel-log-starter</artifactId>
+        </dependency>
+
+        <!-- test -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-spring</artifactId>
+            <version>${camel-version}</version>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring-boot-version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/quartz/src/main/java/sample/camel/Application.java b/quartz/src/main/java/sample/camel/Application.java
new file mode 100644
index 0000000..b198bf8
--- /dev/null
+++ b/quartz/src/main/java/sample/camel/Application.java
@@ -0,0 +1,37 @@
+/*
+ * 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 sample.camel;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+//CHECKSTYLE:OFF
+/**
+ * A sample Spring Boot application that starts the Camel routes.
+ */
+@SpringBootApplication
+public class Application {
+
+    /**
+     * A main method to start this application.
+     */
+    public static void main(String[] args) {
+        SpringApplication.run(Application.class, args);
+    }
+
+}
+//CHECKSTYLE:ON
diff --git a/quartz/src/main/java/sample/camel/QuartzRoute.java b/quartz/src/main/java/sample/camel/QuartzRoute.java
new file mode 100644
index 0000000..d9d0868
--- /dev/null
+++ b/quartz/src/main/java/sample/camel/QuartzRoute.java
@@ -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.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.springframework.stereotype.Component;
+
+@Component
+public class QuartzRoute extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+        from("quartz://myGroup/myTimerName?cron=0/5+*+*+*+*+?")
+            .setBody(constant("Test"))
+            .to("log:info");
+    }
+
+}
diff --git a/quartz/src/main/resources/application.properties b/quartz/src/main/resources/application.properties
new file mode 100644
index 0000000..9f04abe
--- /dev/null
+++ b/quartz/src/main/resources/application.properties
@@ -0,0 +1,25 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# give Camel a name
+camel.springboot.name = Quartz-to-Log
+
+# keep camel running
+camel.springboot.main-run-controller = true
+
+# automatic shutdown after 60 seconds
+camel.springboot.duration-max-seconds = 60

[camel-spring-boot-examples] 03/04: Fixed Names

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git

commit 75ac45527907b4e9e0f00045811b8b9d09f6ba22
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 17 18:42:39 2021 +0100

    Fixed Names
---
 quartz/pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/quartz/pom.xml b/quartz/pom.xml
index 62e0141..a368479 100644
--- a/quartz/pom.xml
+++ b/quartz/pom.xml
@@ -27,9 +27,9 @@
         <version>3.13.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>camel-example-spring-boot-pojo</artifactId>
-    <name>Camel SB Examples :: POJO Routing</name>
-    <description>An example showing how to work with Camel POJO routing with Spring Boot</description>
+    <artifactId>camel-example-spring-boot-quartz</artifactId>
+    <name>Camel SB Examples :: Quartz</name>
+    <description>An example showing how to work with Camel Quartz and Camel Log with Spring Boot</description>
 
     <properties>
         <category>Beginner</category>

[camel-spring-boot-examples] 04/04: Readme updated

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git

commit 92c49e1794e856d03dadf7444453359df7373ab3
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 17 21:23:13 2021 +0100

    Readme updated
---
 README.adoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.adoc b/README.adoc
index c015cba..cf1bafc 100644
--- a/README.adoc
+++ b/README.adoc
@@ -27,7 +27,7 @@ readme's instructions.
 === Examples
 
 // examples: START
-Number of Examples: 52 (0 deprecated)
+Number of Examples: 53 (0 deprecated)
 
 [width="100%",cols="4,2,4",options="header"]
 |===
@@ -47,6 +47,8 @@ Number of Examples: 52 (0 deprecated)
 
 | link:pojo/README.adoc[Pojo] (pojo) | Beginner | An example showing how to work with Camel POJO routing with Spring Boot
 
+| link:quartz/README.adoc[Quartz] (quartz) | Beginner | An example showing how to work with Camel Quartz and Camel Log with Spring Boot
+
 | link:rest-openapi-simple/README.adoc[REST OpenApi] (rest-openapi-simple) | Beginner | This example shows how to call a Rest service defined using OpenApi specification
 
 | link:rest-swagger-simple/README.adoc[REST Swagger] (rest-swagger-simple) | Beginner | This example shows how to call a Rest service defined using Swagger specification