camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lburgazz...@apache.org
Subject [1/3] camel git commit: Document CAMEL-10419 and CAMEL-10417
Date Fri, 04 Nov 2016 16:02:32 GMT
Repository: camel
Updated Branches:
  refs/heads/master a4e94f036 -> 4589f741c


Document CAMEL-10419 and CAMEL-10417


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4589f741
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4589f741
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4589f741

Branch: refs/heads/master
Commit: 4589f741cccd05b498deeb3d894d619dcfbe1b57
Parents: a7d4132
Author: lburgazzoli <lburgazzoli@gmail.com>
Authored: Fri Nov 4 15:37:40 2016 +0100
Committer: lburgazzoli <lburgazzoli@gmail.com>
Committed: Fri Nov 4 16:44:44 2016 +0100

----------------------------------------------------------------------
 .../src/main/docs/properties-component.adoc     | 47 +++++++++++++++++---
 1 file changed, 41 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4589f741/camel-core/src/main/docs/properties-component.adoc
----------------------------------------------------------------------
diff --git a/camel-core/src/main/docs/properties-component.adoc b/camel-core/src/main/docs/properties-component.adoc
index 5973dbd..0a6f4a9 100644
--- a/camel-core/src/main/docs/properties-component.adoc
+++ b/camel-core/src/main/docs/properties-component.adoc
@@ -160,6 +160,17 @@ with comma such as:
 pc.setLocation("com/mycompany/myprop.properties,com/mycompany/other.properties");
 ----
 
+*Available as of Camel 2.19.0*
+
+You can set which location can be discarded if missing by by setting the ``optional`` attribute,
which is false by default, i.e:
+
+[source,java]
+----
+pc.setLocations(
+    "com/mycompany/override.properties;optional=true"
+    "com/mycompany/defaults.properties");
+----
+
 [[Properties-Usingsystemandenvironmentvariablesinlocations]]
 Using system and environment variables in locations
 +++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -274,6 +285,28 @@ fresh such as:
 </camelContext>
 ----
 
+Setting the properties location through the location tag works just fine but sometime you
have a number of resources to take into account and starting from *Camel 2.19.0* you can set
the properties location with a dedicated propertiesLocation:
+
+[source,xml]
+----
+<camelContext ...>
+  <propertyPlaceholder id="myPropertyPlaceholder">
+    <propertiesLocation
+      resolver = "classpath"
+      path     = "com/my/company/something/my-properties-1.properties"
+      optional = "false"/>
+    <propertiesLocation
+      resolver = "classpath"
+      path     = "com/my/company/something/my-properties-2.properties"
+      optional = "false"/>
+    <propertiesLocation
+      resolver = "file"
+      path     = "${karaf.home}/etc/my-override.properties"
+      optional = "true"/>
+   </propertyPlaceholder>
+</camelContext>
+----
+
 [TIP]
 **Specifying the cache option inside XML** +
 Camel 2.10 onwards supports specifying a value for the cache option both
@@ -531,7 +564,7 @@ OSGi Blueprint property placeholder in the XML file as shown below:
            xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
            xsi:schemaLocation="
            http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
- 
+
     <!-- OSGI blueprint property placeholder -->
     <cm:property-placeholder id="myblueprint.placeholder" persistent-id="camel.blueprint">
         <!-- list some properties as needed -->
@@ -539,7 +572,7 @@ OSGi Blueprint property placeholder in the XML file as shown below:
             <cm:property name="result" value="mock:result"/>
         </cm:default-properties>
     </cm:property-placeholder>
- 
+
     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
         <!-- in the route we can use {{ }} placeholders which will lookup in blueprint
              as Camel will auto detect the OSGi blueprint property placeholder and use it
-->
@@ -587,7 +620,7 @@ placeholder by its id. For that you need to use the Camel's
            xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
            xsi:schemaLocation="
            http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
- 
+
     <!-- OSGI blueprint property placeholder -->
     <cm:property-placeholder id="myblueprint.placeholder" persistent-id="camel.blueprint">
         <!-- list some properties as needed -->
@@ -595,13 +628,13 @@ placeholder by its id. For that you need to use the Camel's
             <cm:property name="prefix.result" value="mock:result"/>
         </cm:default-properties>
     </cm:property-placeholder>
- 
+
     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
         <!-- using Camel properties component and refer to the blueprint property placeholder
by its id -->
         <propertyPlaceholder id="properties" location="blueprint:myblueprint.placeholder"
                              prefixToken="[[" suffixToken="]]"
                              propertyPrefix="prefix."/>
- 
+
         <!-- in the route we can use {{ }} placeholders which will lookup in blueprint
-->
         <route>
             <from uri="direct:start"/>
@@ -968,7 +1001,7 @@ placeholder. This is best illustrated in the example code below
   <bean id="beerFunction" class="MyBeerFunction"/>
 
   <camelContext xmlns="http://camel.apache.org/schema/blueprint">
-    <propertyPlaceholder id="properties" location="none" ignoreMissingLocation="true">
+    <propertyPlaceholder id="properties">
       <propertiesFunction ref="beerFunction"/>
     </propertyPlaceholder>
 
@@ -980,6 +1013,8 @@ placeholder. This is best illustrated in the example code below
   </camelContext>
 ----
 
+NOTE: from *camel 2.19.0* the location attribute (on propertyPlaceholder tag) is not more
mandatory
+
 Here we have a Camel XML route where we have defined the
 `<propertyPlaceholder>` to use a custom function, which we refer to be the
 bean id - eg the `beerFunction`. As the beer function uses `"beer"` as its


Mime
View raw message