You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Troy Smith (JIRA)" <ji...@apache.org> on 2019/07/18 17:39:00 UTC

[jira] [Comment Edited] (CAMEL-13758) Unable to parse $simple{}, when you have prefixToken="${" suffixToken="}" in the propertyPlaceholder

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

Troy Smith edited comment on CAMEL-13758 at 7/18/19 5:38 PM:
-------------------------------------------------------------

Hi Claus,

When I use the defaults \{{ }} it breaks something else. For example - 

<setHeader headerName="CamelHttpUri">
 <simple>\{{rpf.webservice.url}}?criteria=\{"pst_num":[{"start":$simple{in.header.accountNumber}}],"max":{}}&amp;userid=none&amp;fields=secr_num,reg_cde&amp;limit=100000000</simple>
 </setHeader>

Caused by: java.lang.IllegalArgumentException: *Missing {{ from the text:* [http://localhost:8585/app?criteria=\|http://localhost:8585/app?criteria=]{"pst_num":[\\{"start":$simple{in.header.accountNumber}}],"max":{}}&userid=none&fields=secr_num,reg_cde&limit=100000000


was (Author: troy smith):
Hi Claus,

When I use the defaults \{{ }} it breaks something else. For example - 

<setHeader headerName="CamelHttpUri">
 <simple>{{*{{webservice.url}}}}*?criteria={"pst_num":[\{"start":*$simple{in.header.accountNumber}}],"max":{}}&userid=none&fields=secr_num,reg_cde&limit=100000000</simple> 
 </setHeader>

Caused by: java.lang.IllegalArgumentException: *Missing {{ from the text:* [http://localhost:8585/app?criteria=\|http://localhost:8585/app?criteria=]{"pst_num":[\{"start":$simple{in.header.accountNumber}}],"max":{}}&userid=none&fields=secr_num,reg_cde&limit=100000000

> Unable to parse $simple{}, when you have prefixToken="${" suffixToken="}" in the propertyPlaceholder
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-13758
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13758
>             Project: Camel
>          Issue Type: Bug
>          Components: came-core
>    Affects Versions: 2.16.4, 2.24.1
>            Reporter: Troy Smith
>            Assignee: Claus Ibsen
>            Priority: Minor
>         Attachments: camel-test.zip, log.log
>
>
> Unable to parse $simple{}, when you have prefixToken={color:#14892c}"$\{"{color} suffixToken={color:#14892c}"}{color}" in the propertyPlaceholder.
> For example -
> {{<camelContext xmlns="http://camel.apache.org/schema/spring"> <propertyPlaceholder id="ignoreId" location="classpath:reformMB.properties" prefixToken="${" suffixToken="}"/> <route id="sendNotification"> <from uri="jms:queue:queue.sendNotification"/> <to uri="file:${OnDemand.output.url}?fileName=RPFPos_L2W.$simple\{in.header.accountNum}-${date:now:yyyyMMddHHmmssSSS}.csv"/> </route> </camelContext>}}
>  
> In the above route ${OnDemand.output.url} {color:#333333}is a Spring property placeholders and $simple\{in.header.accountNum}{color} is a camel property placeholder.
> {{{color:#205081}Note:- This route configuration used to work till Camel 2.12{color}}}
> {{According to [https://github.com/apache/camel/blob/master/docs/user-manual/modules/ROOT/pages/using-propertyplaceholder.adoc]- one should be able to refer to Camel's properties using $simple\{...} like this:}}
>  
> {{<setHeader headerName="Exchange.FILE_NAME"> <simple>{{file.rootdir}}{{/$simple\{in.header.CamelFileName}</simple </setHeader>}}
>  
> {{Replication - camel-test.zip attached. Main class - CamelHelloWorldSpringExample.java}}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)