You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/08/04 07:19:00 UTC

[jira] [Commented] (CAMEL-18329) RouteTemplate: templateParameter doesn't get resolved

    [ https://issues.apache.org/jira/browse/CAMEL-18329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17575076#comment-17575076 ] 

Claus Ibsen commented on CAMEL-18329:
-------------------------------------

You need to use an expression language to have it dynamic

.transform(simple("${body}{{append}}"))

The body().append(xxx) works as a constant value - it would also not replace in regular Camel route (without route templates).

> RouteTemplate: templateParameter doesn't get resolved
> -----------------------------------------------------
>
>                 Key: CAMEL-18329
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18329
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 3.18.0
>            Reporter: Raymond
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.18.1, 3.19.0
>
>
> I have a routetemplate:
> {code:java}
> routeTemplate("appendtobody")
>   .templateParameter("append")
>   .templateParameter("in")
>   .templateParameter("out")
> .from("{{in}}")
> .transform(body().append("{{append}}"))
> .to("{{out}}");{code}
>  
> I create the route from template like this:
> {code:java}
> <templatedRoutes xmlns="http://camel.apache.org/schema/spring">
>    <templatedRoute routeId="100-2" routeTemplateRef="appendtobody">
>       <parameter name="append" value="appendvalue"/>
>       <parameter name="out" value="file://C/messages/in"/>
>       <parameter name="in" value="file://C/messages/out"/>
>    </templatedRoute>
> </templatedRoutes>{code}
> I call it with a file that contains: "value" in the body.
> Expected output:
> {code:java}
> valueappendvalue
> {code}
> Actual output:
> {code:java}
> value{{append}}
> {code}
> Tested this scenario with 3.18.0 and 3.19.0-SNAPSHOT
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)