This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new bb62929 Polished bb62929 is described below commit bb629296bdc8fb86441ed7848df8b445c7a9d1b6 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Mar 6 14:24:52 2018 +0100 Polished --- camel-core/src/main/docs/constant-language.adoc | 11 ++++++++--- .../main/java/org/apache/camel/builder/ExpressionClause.java | 5 ++++- .../org/apache/camel/builder/ExpressionClauseSupport.java | 5 ++++- .../org/apache/camel/model/language/ConstantExpression.java | 3 +++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/camel-core/src/main/docs/constant-language.adoc b/camel-core/src/main/docs/constant-language.adoc index 6bb2f44..cbb7e82 100644 --- a/camel-core/src/main/docs/constant-language.adoc +++ b/camel-core/src/main/docs/constant-language.adoc @@ -6,6 +6,9 @@ The Constant Expression Language is really just a way to specify constant strings as a type of expression. +NOTE: This is a fixed constant value that is only set once during starting up the route, + do not use this if you want dynamic values during routing. + === Constant Options @@ -32,9 +35,9 @@ expression like: <route> <from uri="seda:a"/> <setHeader headerName="theHeader"> - <constant>the value</constant> + <constant>the value</constant> </setHeader> - <to uri="mock:b"/> + <to uri="mock:b"/> </route> ---- @@ -46,7 +49,9 @@ And the same example using Java DSL: [source,java] ---- -from("seda:a").setHeader("theHeader", constant("the value")).to("mock:b"); +from("seda:a") + .setHeader("theHeader", constant("the value")) + .to("mock:b"); ---- === Dependencies diff --git a/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java b/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java index 16714d4..52af129 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java +++ b/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java @@ -59,7 +59,10 @@ public class ExpressionClause<T> extends ExpressionDefinition { } /** - * Specify the constant expression value + * Specify the constant expression value. + * + * <b>Important:</b> this is a fixed constant value that is only set once during starting up the route, + * do not use this if you want dynamic values during routing. */ public T constant(Object value) { return delegate.constant(value); diff --git a/camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java b/camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java index 91b2d3f..e732c3c 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java +++ b/camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java @@ -79,7 +79,10 @@ public class ExpressionClauseSupport<T> { } /** - * Specify the constant expression value + * Specify the constant expression value. + * + * <b>Important:</b> this is a fixed constant value that is only set once during starting up the route, + * do not use this if you want dynamic values during routing. */ public T constant(Object value) { if (value instanceof String) { diff --git a/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java b/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java index 76749db..4390a0c 100644 --- a/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java +++ b/camel-core/src/main/java/org/apache/camel/model/language/ConstantExpression.java @@ -24,6 +24,9 @@ import org.apache.camel.spi.Metadata; /** * To use a constant value in Camel expressions or predicates. + * + * <b>Important:</b> this is a fixed constant value that is only set once during starting up the route, + * do not use this if you want dynamic values during routing. */ @Metadata(firstVersion = "1.5.0", label = "language,core", title = "Constant") @XmlRootElement(name = "constant") -- To stop receiving notification emails like this one, please contact davscl...@apache.org.