You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/09/22 15:34:35 UTC
[GitHub] [camel-quarkus-examples] Delawen opened a new pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Delawen opened a new pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54
Adding an example as suggested in https://github.com/apache/camel-quarkus/issues/3056
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] Delawen commented on pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
Delawen commented on pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#issuecomment-925856912
> How can I fail... uncommitted changes? How...???
Ah, didn't see the other comment above :) Thanks :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] Delawen commented on pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
Delawen commented on pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#issuecomment-925726881
Everything should be in order now. Let's see what the workflow says :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] Delawen commented on pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
Delawen commented on pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#issuecomment-925856601
How can I fail... uncommitted changes? How...???
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] jamesnetherton commented on a change in pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#discussion_r714506147
##########
File path: jdbc-datasource/pom.xml
##########
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.camel.quarkus.examples</groupId>
+ <artifactId>camel-quarkus-examples-jdbc-datasource</artifactId>
+ <version>2.2.0</version>
+ <name>Camel Quarkus :: Examples :: Jdbc - DatataSource - Log</name>
+ <description>Camel Quarkus Example :: Connect to Database using Datasource</description>
+ <properties>
+ <camel-quarkus.version>2.2.0</camel-quarkus.version>
+ <formatter-maven-plugin.version>2.11.0</formatter-maven-plugin.version>
+ <impsort-maven-plugin.version>1.3.2</impsort-maven-plugin.version>
+ <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
+ <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
+ <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven.compiler.source>11</maven.compiler.source>
+ <maven.compiler.target>11</maven.compiler.target>
+ <maven.compiler.testSource>${maven.compiler.source}</maven.compiler.testSource>
+ <maven.compiler.testTarget>${maven.compiler.target}</maven.compiler.testTarget>
+ <mycila-license.version>3.0</mycila-license.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <quarkus.version>2.2.0.Final</quarkus.version>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom</artifactId>
+ <version>${camel-quarkus.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom-test</artifactId>
+ <version>${camel-quarkus.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-microprofile-health</artifactId>
Review comment:
Unless there's a 'deploy to cloud' element to this example I guess we could live without the health extension?
##########
File path: jdbc-datasource/src/main/resources/application.properties
##########
@@ -0,0 +1,44 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+#
+# Quarkus
+#
+quarkus.banner.enabled = false
+quarkus.log.file.enable = true
+
+camel.main.routes-include-pattern = file:src/main/resources/routes/camel-routes.xml
+
+#Create table automatically on database
+quarkus.hibernate-orm.database.generation=drop-and-create
Review comment:
If this is the primary use of the JPA extension, maybe we should do the drop / create step manually via a startup observer or `@PostContruct` step. Example here:
https://github.com/apache/camel-quarkus/blob/main/integration-tests/jdbc/src/main/java/org/apache/camel/quarkus/component/jdbc/CamelResource.java#L51-L65
Then we can remove the `camel-quarkus-jpa` dependency and the `Camel` entity class.
##########
File path: jdbc-datasource/pom.xml
##########
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.camel.quarkus.examples</groupId>
+ <artifactId>camel-quarkus-examples-jdbc-datasource</artifactId>
+ <version>2.2.0</version>
Review comment:
version should be `2.3.0-SNAPSHOT`.
##########
File path: jdbc-datasource/README.adoc
##########
@@ -0,0 +1,73 @@
+= Connecting to a JDBC DataSource: A Camel Quarkus example
+:cq-example-description: An example that shows how to define a Camel route in XML for tokenizing a CSV a file.
Review comment:
Description needs updating.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] jamesnetherton commented on a change in pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#discussion_r714535156
##########
File path: jdbc-datasource/README.adoc
##########
@@ -0,0 +1,73 @@
+= Connecting to a JDBC DataSource: A Camel Quarkus example
+:cq-example-description: An example that shows how to define a Camel route in XML for tokenizing a CSV a file.
+
+{cq-description}
+
+In particular, it demonstrates the following:
+
+1. Defining a DataSource
+2. Querying the Database defined in the previous DataSource
+4. Usage of properties defined in `application.properties`
+5. No Java code required or used, the route defined in XML can still be compiled to native code.
+
+This example will connect to an H2 database with the connection details defined in `application.properties`.
+If the example is run on Development mode and no database exists, Quarkus will create a matching database
+https://quarkus.io/guides/datasource#dev-services[as described here].
+
+TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Camel Quarkus User guide] for prerequisites
+and other general information.
+
+== Start in the Development mode
+
+[source,shell]
+----
+$ mvn clean compile quarkus:dev
+----
+
+The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your
+workspace. Any modifications in your project will automatically take effect in the running application.
+
+TIP: Please refer to the Development mode section of
+https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
+
+Once the application has started it will wait 5 seconds and then read the file every 30 seconds. By default the row split
+is sequential however you can edit the properties file and set the parallel processing to true. The output should then be
Review comment:
It's fine to add to an existing one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] jamesnetherton merged pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
jamesnetherton merged pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] Delawen commented on a change in pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
Delawen commented on a change in pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#discussion_r714523684
##########
File path: jdbc-datasource/README.adoc
##########
@@ -0,0 +1,73 @@
+= Connecting to a JDBC DataSource: A Camel Quarkus example
+:cq-example-description: An example that shows how to define a Camel route in XML for tokenizing a CSV a file.
+
+{cq-description}
+
+In particular, it demonstrates the following:
+
+1. Defining a DataSource
+2. Querying the Database defined in the previous DataSource
+4. Usage of properties defined in `application.properties`
+5. No Java code required or used, the route defined in XML can still be compiled to native code.
+
+This example will connect to an H2 database with the connection details defined in `application.properties`.
+If the example is run on Development mode and no database exists, Quarkus will create a matching database
+https://quarkus.io/guides/datasource#dev-services[as described here].
+
+TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Camel Quarkus User guide] for prerequisites
+and other general information.
+
+== Start in the Development mode
+
+[source,shell]
+----
+$ mvn clean compile quarkus:dev
+----
+
+The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your
+workspace. Any modifications in your project will automatically take effect in the running application.
+
+TIP: Please refer to the Development mode section of
+https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
+
+Once the application has started it will wait 5 seconds and then read the file every 30 seconds. By default the row split
+is sequential however you can edit the properties file and set the parallel processing to true. The output should then be
Review comment:
Oh, that's a part I didn't update that comes from the example I used as template. Removing it now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] Delawen commented on pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
Delawen commented on pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#issuecomment-926405254
> It's sort of the wrong thing to do, but at least it's consistently wrong with the other examples.
"Consistently wrong". I'm taking that :D
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] zbendhiba commented on a change in pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
zbendhiba commented on a change in pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#discussion_r714121293
##########
File path: jdbc-datasource/README.adoc
##########
@@ -0,0 +1,73 @@
+= Connecting to a JDBC DataSource: A Camel Quarkus example
+:cq-example-description: An example that shows how to define a Camel route in XML for tokenizing a CSV a file.
+
+{cq-description}
+
+In particular, it demonstrates the following:
+
+1. Defining a DataSource
+2. Querying the Database defined in the previous DataSource
+4. Usage of properties defined in `application.properties`
+5. No Java code required or used, the route defined in XML can still be compiled to native code.
+
+This example will connect to an H2 database with the connection details defined in `application.properties`.
+If the example is run on Development mode and no database exists, Quarkus will create a matching database
+https://quarkus.io/guides/datasource#dev-services[as described here].
+
+TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Camel Quarkus User guide] for prerequisites
+and other general information.
+
+== Start in the Development mode
+
+[source,shell]
+----
+$ mvn clean compile quarkus:dev
+----
+
+The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your
+workspace. Any modifications in your project will automatically take effect in the running application.
+
+TIP: Please refer to the Development mode section of
+https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
+
+Once the application has started it will wait 5 seconds and then read the file every 30 seconds. By default the row split
+is sequential however you can edit the properties file and set the parallel processing to true. The output should then be
Review comment:
Maybe we need a "," or "." before the _however_.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] Delawen commented on a change in pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
Delawen commented on a change in pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#discussion_r714525416
##########
File path: jdbc-datasource/README.adoc
##########
@@ -0,0 +1,73 @@
+= Connecting to a JDBC DataSource: A Camel Quarkus example
+:cq-example-description: An example that shows how to define a Camel route in XML for tokenizing a CSV a file.
+
+{cq-description}
+
+In particular, it demonstrates the following:
+
+1. Defining a DataSource
+2. Querying the Database defined in the previous DataSource
+4. Usage of properties defined in `application.properties`
+5. No Java code required or used, the route defined in XML can still be compiled to native code.
+
+This example will connect to an H2 database with the connection details defined in `application.properties`.
+If the example is run on Development mode and no database exists, Quarkus will create a matching database
+https://quarkus.io/guides/datasource#dev-services[as described here].
+
+TIP: Check the https://camel.apache.org/camel-quarkus/latest/first-steps.html[Camel Quarkus User guide] for prerequisites
+and other general information.
+
+== Start in the Development mode
+
+[source,shell]
+----
+$ mvn clean compile quarkus:dev
+----
+
+The above command compiles the project, starts the application and lets the Quarkus tooling watch for changes in your
+workspace. Any modifications in your project will automatically take effect in the running application.
+
+TIP: Please refer to the Development mode section of
+https://camel.apache.org/camel-quarkus/latest/first-steps.html#_development_mode[Camel Quarkus User guide] for more details.
+
+Once the application has started it will wait 5 seconds and then read the file every 30 seconds. By default the row split
+is sequential however you can edit the properties file and set the parallel processing to true. The output should then be
Review comment:
> I guess you'd need to add the example in the https://github.com/apache/camel-quarkus-examples/blob/main/.github/test-categories.yaml, so that it could get compiled by the CI build
Should I create a new category for database things?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] jamesnetherton commented on pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#issuecomment-925835725
> Everything should be in order now. Let's see what the workflow says :)
Can you run the `update-examples-json` step again to sync the description. I think you can remove the empty dangling file in `jdbc-datasource/docs/modules/ROOT/attachments/examples.json`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] jamesnetherton commented on pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#issuecomment-926400462
Sorry - I gave some incorrect advice in my review comment about removing `camel-quarkus-microprofile-health`. If you add it back, the native test should pass.
It's sort of the wrong thing to do, but at least it's consistently wrong with the other examples. I can look into tidying things up after this is merged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel-quarkus-examples] Delawen commented on a change in pull request #54: example(jdbc-datastore): #3056 Adding new simple example
Posted by GitBox <gi...@apache.org>.
Delawen commented on a change in pull request #54:
URL: https://github.com/apache/camel-quarkus-examples/pull/54#discussion_r714526662
##########
File path: jdbc-datasource/src/main/resources/application.properties
##########
@@ -0,0 +1,44 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+#
+# Quarkus
+#
+quarkus.banner.enabled = false
+quarkus.log.file.enable = true
+
+camel.main.routes-include-pattern = file:src/main/resources/routes/camel-routes.xml
+
+#Create table automatically on database
+quarkus.hibernate-orm.database.generation=drop-and-create
Review comment:
Good one!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org