camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-8309) Camel XML DSL - Allow to specify uri attributes in multi lines to make long urs easier to read and maintain
Date Mon, 02 Feb 2015 18:42:36 GMT
Claus Ibsen created CAMEL-8309:
----------------------------------

             Summary: Camel XML DSL - Allow to specify uri attributes in multi lines to make
long urs easier to read and maintain
                 Key: CAMEL-8309
                 URL: https://issues.apache.org/jira/browse/CAMEL-8309
             Project: Camel
          Issue Type: Improvement
          Components: camel-blueprint, camel-spring
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 2.15.0


If you have very long uris in routes, then in Java DSL you can just split the code into new
lines, as its just Java code.

But in XML you cannot do that. So we should allow the uri attribute to have new lines, and
then when parsing the CamelContext we remove those whitespace noise, so the uri is one line.

The parser does this partly when you obtain the attribute. All new lines, tabs etc is represented
as a space. But then the url has double spaces, we need to trim, in the parser.

You will still have to use &amp; to separate the options though

Here is a very little example with only 2 options, but just imagine if the url was longer

{code}
        <route>
            <from uri="direct:start"/>
            <to uri="seda:bar?timeout=10000
              &amp;blockWhenFull=true"/>
        </route>

        <route>
            <from uri="seda:bar?
              timeout=10000&amp;
              blockWhenFull=true"/>
            <to uri="mock:bar"/>
        </route>
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message