You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/01/06 06:53:05 UTC
[jira] Commented: (CAMEL-1226) String formatter / interpolator for
dsl uris
[ https://issues.apache.org/activemq/browse/CAMEL-1226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48485#action_48485 ]
Claus Ibsen commented on CAMEL-1226:
------------------------------------
I think the builder for *to* already have varargs for a pipeline with N destinations.
{code}
from("direct:start").to("log:foo", "bean:validate", "bean:process", "mail:xxxx")
{code}
So it can't really be done without adding some rules such as if the first parameter is a string and it has {1} placeholders then these remaining parameters are for these placeholders.
Or something like that.
Any ideas?
But the idea is very cool and something I would like to have as well. Making the route much easier to read as well. I kinda miss Groovy and it's $ support for Strings. Damm Java starts to feel "old"
> 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.