davsclaus commented on code in PR #30398:
URL: https://github.com/apache/camel/pull/30398#discussion_r4629328320
##########
core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java:
##########
@@ -1874,6 +1973,23 @@ public Builder withPlaceholder(boolean placeholder) {
return this;
}
+ /**
+ * Whether to bind in literal mode, for values computed from message
content at runtime (for example the option
+ * values of a dynamic endpoint). In literal mode a value with a
property placeholder ({@code {{...}}}), a
+ * {@code #class:} value or a {@code #property:} value is bound as
literal text, and option names are not
+ * resolved as property placeholders. Plain registry references
({@code #bean:}, {@code #type:}, {@code #name})
+ * are still resolved.
+ * <p>
+ * Literal mode is also on, whatever this option says, while a literal
option binding scope is active on the
+ * current thread, see {@link
PropertyBindingSupport#isLiteralOptionBinding()}.
+ *
+ * @since 4.24
Review Comment:
Done in 6620f22e3674 (@since 4.18.6).
_Claude Code on behalf of Claus Ibsen_
##########
core/camel-support/src/main/java/org/apache/camel/support/component/RawParameterHelper.java:
##########
@@ -36,12 +37,37 @@ private RawParameterHelper() {
* The value can refer to a simple expression using $simple{xxx} syntax
which allows to refer to passwords defined
* as ENV variables etc.
*
+ * When the endpoint currently being created on this thread binds its
option values as literal text (see
+ * {@link PropertyBindingSupport#isLiteralOptionBinding()}), the RAW
tokens are removed but a $simple{xxx} in the
+ * value is not evaluated, see {@link
#resolveRawParameterValues(CamelContext, Map, boolean)}.
+ *
* @param camelContext the camel context
* @param parameters the uri parameters
*/
public static void resolveRawParameterValues(CamelContext camelContext,
Map<String, Object> parameters) {
+ resolveRawParameterValues(camelContext, parameters,
PropertyBindingSupport.isLiteralOptionBinding());
+ }
+
+ /**
+ * Traverses the given parameters, and resolves any parameter values which
use the RAW token syntax:
+ * <code>key=RAW(value)</code>. This method will then remove the RAW
tokens, and replace the content of the value,
+ * with just the value.
+ *
+ * When {@code literal} is {@code false} the value can refer to a simple
expression using $simple{xxx} syntax which
+ * allows to refer to passwords defined as ENV variables etc. When {@code
literal} is {@code true} the value is
+ * taken as literal text and a $simple{xxx} in it is not evaluated. This
is used for an endpoint whose uri was
+ * computed from the current message at runtime (for example the
per-message recipient of {@code toD} or
+ * {@code pollEnrich}), as its option values come from the message and not
from the route.
+ *
+ * @param camelContext the camel context
+ * @param parameters the uri parameters
+ * @param literal whether the RAW values are taken as literal text,
without evaluating $simple{xxx}
+ * @since 4.24
Review Comment:
Done in 6620f22e3674 (@since 4.18.6).
_Claude Code on behalf of Claus Ibsen_
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]