You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/03/12 08:50:25 UTC

[camel-k-runtime] branch master updated (6f72bba -> efb7df4)

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

lburgazzoli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git.


    from 6f72bba  chore: cleanup pom and boms
     new ba9a261  Allow to configure quarkus through runtime's application properties
     new efb7df4  Amend amel-k-runtime-example-quarkus-yaml to show how to configure quarkus through runtime properties

The 2 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:
 .../ApplicationRuntimeConfigSourceProvider.java    | 47 ++++++++++++++++++++++
 ...se.microprofile.config.spi.ConfigSourceProvider |  3 +-
 .../data/application.properties                    |  6 +++
 .../data/routes.yaml                               |  2 +-
 .../camel-k-runtime-example-quarkus-yaml/pom.xml   |  7 +++-
 5 files changed, 61 insertions(+), 4 deletions(-)
 create mode 100644 camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/java/org/apache/camel/k/quarkus/ApplicationRuntimeConfigSourceProvider.java
 copy camel-k-loader-groovy/src/main/resources/META-INF/services/org/apache/camel/k/loader/groovy => camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider (92%)


[camel-k-runtime] 02/02: Amend amel-k-runtime-example-quarkus-yaml to show how to configure quarkus through runtime properties

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

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git

commit efb7df409d18e3b7275bb42ceb9d4dcfbb3f99bf
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Thu Mar 12 09:34:52 2020 +0100

    Amend amel-k-runtime-example-quarkus-yaml to show how to configure quarkus through runtime properties
---
 .../data/application.properties                                    | 6 ++++++
 examples/camel-k-runtime-example-quarkus-yaml/data/routes.yaml     | 2 +-
 examples/camel-k-runtime-example-quarkus-yaml/pom.xml              | 7 ++++++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/examples/camel-k-runtime-example-quarkus-yaml/data/application.properties b/examples/camel-k-runtime-example-quarkus-yaml/data/application.properties
index 6fde22c..404ae13 100644
--- a/examples/camel-k-runtime-example-quarkus-yaml/data/application.properties
+++ b/examples/camel-k-runtime-example-quarkus-yaml/data/application.properties
@@ -16,6 +16,11 @@
 ## ---------------------------------------------------------------------------
 
 #
+# Quarkus
+#
+quarkus.http.port = 9988
+
+#
 # camel - main
 #
 camel.main.name = camel-q
@@ -26,3 +31,4 @@ camel.main.stream-caching-spool-directory = ${java.io.tmpdir}/camel-q
 # Integration
 #
 message = test-app
+
diff --git a/examples/camel-k-runtime-example-quarkus-yaml/data/routes.yaml b/examples/camel-k-runtime-example-quarkus-yaml/data/routes.yaml
index 3549758..f634446 100644
--- a/examples/camel-k-runtime-example-quarkus-yaml/data/routes.yaml
+++ b/examples/camel-k-runtime-example-quarkus-yaml/data/routes.yaml
@@ -19,7 +19,7 @@
     id: "flow-1"
     group: "routes"
     from:
-      uri: "netty-http:localhost:8080"
+      uri: "platform-http://hello"
       steps:
         - convert-body:
             type: "java.lang.String"
diff --git a/examples/camel-k-runtime-example-quarkus-yaml/pom.xml b/examples/camel-k-runtime-example-quarkus-yaml/pom.xml
index 8d61a41..a0a52b9 100644
--- a/examples/camel-k-runtime-example-quarkus-yaml/pom.xml
+++ b/examples/camel-k-runtime-example-quarkus-yaml/pom.xml
@@ -57,7 +57,7 @@
 
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-netty-http</artifactId>
+            <artifactId>camel-quarkus-platform-http</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
@@ -83,6 +83,11 @@
             <artifactId>quarkus-vertx-core</artifactId>
             <version>${quarkus.version}</version>
         </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-vertx-http</artifactId>
+            <version>${quarkus.version}</version>
+        </dependency>
     </dependencies>
 
     <build>


[camel-k-runtime] 01/02: Allow to configure quarkus through runtime's application properties

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

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git

commit ba9a26132464dba5bd4859935e3c77a843c89d19
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Thu Mar 12 09:34:14 2020 +0100

    Allow to configure quarkus through runtime's application properties
---
 .../ApplicationRuntimeConfigSourceProvider.java    | 47 ++++++++++++++++++++++
 ...se.microprofile.config.spi.ConfigSourceProvider | 17 ++++++++
 2 files changed, 64 insertions(+)

diff --git a/camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/java/org/apache/camel/k/quarkus/ApplicationRuntimeConfigSourceProvider.java b/camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/java/org/apache/camel/k/quarkus/ApplicationRuntimeConfigSourceProvider.java
new file mode 100644
index 0000000..7cbb9e8
--- /dev/null
+++ b/camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/java/org/apache/camel/k/quarkus/ApplicationRuntimeConfigSourceProvider.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.k.quarkus;
+
+import java.util.Collections;
+import java.util.Properties;
+
+import io.smallrye.config.PropertiesConfigSource;
+import org.apache.camel.k.support.PropertiesSupport;
+import org.eclipse.microprofile.config.spi.ConfigSource;
+import org.eclipse.microprofile.config.spi.ConfigSourceProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ApplicationRuntimeConfigSourceProvider implements ConfigSourceProvider {
+    private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationRuntimeConfigSourceProvider.class);
+
+    @Override
+    public Iterable<ConfigSource> getConfigSources(ClassLoader forClassLoader) {
+        final Properties applicationProperties = PropertiesSupport.loadProperties();
+        final Properties quarkusProperties = new Properties();
+
+        for (String name : applicationProperties.stringPropertyNames()) {
+            if (name.startsWith("quarkus.")) {
+                quarkusProperties.put(name, applicationProperties.get(name));
+            }
+        }
+
+        return Collections.singletonList(
+            new PropertiesConfigSource(quarkusProperties, "camel-k")
+        );
+    }
+}
diff --git a/camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider b/camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider
new file mode 100644
index 0000000..30fe91e
--- /dev/null
+++ b/camel-k-quarkus/camel-k-runtime-quarkus/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider
@@ -0,0 +1,17 @@
+#
+# 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.
+#
+org.apache.camel.k.quarkus.ApplicationRuntimeConfigSourceProvider
\ No newline at end of file