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-spring-boot-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new a5db888  CAMEL-16552: Use spring boot yaml configuration instead of 
properties
a5db888 is described below

commit a5db888de6c1196ad31daddd532cb4cae6a97cca
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Apr 27 12:08:37 2021 +0200

    CAMEL-16552: Use spring boot yaml configuration instead of properties
---
 .../main/java/sample/camel/MyTemplateBuilder.java  |  6 ++--
 .../src/main/resources/application.properties      | 30 --------------------
 routetemplate/src/main/resources/application.yaml  | 32 ++++++++++++++++++++++
 3 files changed, 35 insertions(+), 33 deletions(-)

diff --git a/routetemplate/src/main/java/sample/camel/MyTemplateBuilder.java 
b/routetemplate/src/main/java/sample/camel/MyTemplateBuilder.java
index f0327f2..b440b26 100644
--- a/routetemplate/src/main/java/sample/camel/MyTemplateBuilder.java
+++ b/routetemplate/src/main/java/sample/camel/MyTemplateBuilder.java
@@ -30,9 +30,9 @@ public class MyTemplateBuilder implements 
ConfigureRouteTemplates {
     public void configure(CamelContext context) {
         // to configure route templates we can use java code as below from a 
template builder class,
         // gives more power as its java code.
-        // or we can configure as well from application.properties,
-        // less power as its key value pair properties
-        // and you can also use both java and properties together
+        // or we can configure as well from application.yaml,
+        // less power as its key value pair yaml
+        // and you can also use both java and yaml together
 
         // in this example we use properties by default and have disabled java
         /*
diff --git a/routetemplate/src/main/resources/application.properties 
b/routetemplate/src/main/resources/application.properties
deleted file mode 100644
index c766913..0000000
--- a/routetemplate/src/main/resources/application.properties
+++ /dev/null
@@ -1,30 +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.
-## ---------------------------------------------------------------------------
-
-# the name of Camel
-camel.springboot.name = MyCamel
-
-# create routes from the route template
-# this can also be done in Java code, see MyTemplateBuilder.java
-camel.route-template.config[0].template-id = myTemplate
-camel.route-template.config[0].name = one
-camel.route-template.config[0].greeting = Hello
-camel.route-template.config[1].template-id = myTemplate
-camel.route-template.config[1].name = two
-camel.route-template.config[1].greeting = Bonjour
-camel.route-template.config[1].my-period = 5s
-
diff --git a/routetemplate/src/main/resources/application.yaml 
b/routetemplate/src/main/resources/application.yaml
new file mode 100644
index 0000000..2d44f44
--- /dev/null
+++ b/routetemplate/src/main/resources/application.yaml
@@ -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.
+#
+
+camel:
+  springboot:
+    name: MyCamel
+
+  route-template:
+    config:
+      -0.template-id: myTemplate
+      -0.route-id: first
+      -0.name: one
+      -0.greeting: Hello
+      -1.template-id: myTemplate
+      -1.route-id: second
+      -1.name: two
+      -1.greeting: Bonjour
+      -1.my-period: 5s

Reply via email to