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

Claus Ibsen commented on CAMEL-1226:
------------------------------------

I anticipate you are thinking of using java.text.MessageFormat since the 
placeholders is what it's using.

Not a bad idea with the builder method. I dont think many end users is familiar 
with the intepolate term, so I kinda like:
- toUri
- buildUri
- formatUri
Or what is a good name.

For Spring DSL end users should use <endpoint id="foo" uri="xxx"/> where you 
can use spring property placeholders
And then use ref for this endpoint. <to ref="foo"/>

> String formatter / interpolator for dsl uris
> --------------------------------------------
>
>                 Key: CAMEL-1226
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1226
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Atle Prange
>            Priority: Minor
>
> Often one ends up with dsl expressions that build strings like:
> {code}
>  from("direct:start").to("ldap:localhost:" + port + "?base=" + query);
> {code}
> Would in not be better to write
> {code}
> from("direct:start").to("ldps:localhost:{1}?base={2}", port, query);
> {code}
> , where "{1}" means "the first argument in the string varargs following. ( 
> "{1}" could of course be replaced by some expression that you like the format 
> of)
> To implementent this one could overload the from() and to() methods to accept 
> a vararg array of Strings following the uri argument, and interpolate the uri 
> with the varargs...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to