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/05/28 14:54:51 UTC

[jira] Created: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Properties file component - And allow simple language to access the properties
------------------------------------------------------------------------------

                 Key: CAMEL-1656
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
             Project: Apache Camel
          Issue Type: New Feature
          Components: camel-core
            Reporter: Claus Ibsen
             Fix For: 2.0.0, 2.1.0


People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.

And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.

And let the simple language be able to access these properties as well so people can use it in expressions

{code}
<simple>${propertiesfile:foo:email}</simple>
{code}

And the properties file is could be define something like:
{code}
<endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
{code}

And the file content
{code}
email=someone@somewhere.org
{code}


Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
For instance the simple expression could be:

{code}
<simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
{code}

The above is for quick and dirty.

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


[jira] Commented: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57418#action_57418 ] 

Claus Ibsen commented on CAMEL-1656:
------------------------------------

Got a basic properties component up and running.

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Resolved: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1656.
--------------------------------

    Resolution: Duplicate

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Commented: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51960#action_51960 ] 

Claus Ibsen commented on CAMEL-1656:
------------------------------------

And I think James Strachan have reported something similar.

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>             Fix For: 2.0.0, 2.1.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Commented: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57422#action_57422 ] 

Claus Ibsen commented on CAMEL-1656:
------------------------------------

And you can have placeholders in the properties file itself, which Camel will resolve as well (think recursive)
{code}
cool.end=mock:result
cool.result=result
cool.concat=mock:#{cool.result}
cool.start=direct:cool
cool.showid=true
{code}

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Commented: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57423#action_57423 ] 

Claus Ibsen commented on CAMEL-1656:
------------------------------------

And simple language can not leverage properties as well
{code}
                from("direct:start")
                    .transform().simple("Hi ${body} do you think ${properties:cheese.quote}?");
{code}

With properties
{code}
cheese.quote=Camel rocks
{code}

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Assigned: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-1656:
----------------------------------

    Assignee: Claus Ibsen  (was: Ashwin Karpe)

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Issue Comment Edited: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57421#action_57421 ] 

Claus Ibsen edited comment on CAMEL-1656 at 2/7/10 3:04 PM:
------------------------------------------------------------

You can now do something like this

{code}
                from("#{cool.start}")
                    .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
                    .to("mock:#{cool.result}");
{code}

Where #{ } is the property placeholder syntax to lookup properties. Using #{ } does not clash with ${ } for simple language and it also resembles the # lookup we support on parameters.

Notice how you can define placeholders as only part of the uri or for parameters etc. 

There is also a properties component you can use
{code}
                from("direct:start").to("properties:#{cool.end}");
{code}

Which also supports having only part of the endpoint uri as a placeholder. Notice how {{mock:}} is fixed below 
{code}
                from("direct:start").to("properties:mock:#{cool.result}");
{code}
And it support a locations parameter so you can use non default locations
{code}
                from("direct:start").to("properties:#{bar.end}?locations=org/apache/camel/component/properties/bar.properties");
{code}

      was (Author: davsclaus):
    You can now do something like this

{code}
                from("#{cool.start}")
                    .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
                    .to("mock:#{cool.result}");
{code}

Where #{ } is the property placeholder syntax to lookup properties. Using #{ } does not clash with ${ } for simple language and it also resembles the # lookup we support on parameters.

Notice how you can define placeholders as only part of the uri or for parameters etc. 

There is also a properties component you can use
{code}
                from("direct:start").to("properties:#{cool.end}");
{code}

And it support a locations parameter so you can use non default locations
{code}
                from("direct:start").to("properties:#{bar.end}?locations=org/apache/camel/component/properties/bar.properties");
{code}
  
> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Commented: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57421#action_57421 ] 

Claus Ibsen commented on CAMEL-1656:
------------------------------------

You can now do something like this

{code}
                from("#{cool.start}")
                    .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
                    .to("mock:#{cool.result}");
{code}

Where #{ } is the property placeholder syntax to lookup properties. Using #{ } does not clash with ${ } for simple language and it also resembles the # lookup we support on parameters.

Notice how you can define placeholders as only part of the uri or for parameters etc. 

There is also a properties component you can use
{code}
                from("direct:start").to("properties:#{cool.end}");
{code}

And it support a locations parameter so you can use non default locations
{code}
                from("direct:start").to("properties:#{bar.end}?locations=org/apache/camel/component/properties/bar.properties");
{code}

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Updated: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1656:
-------------------------------

    Fix Version/s:     (was: 2.0.0)

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>             Fix For: 2.1.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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


[jira] Assigned: (CAMEL-1656) Properties file component - And allow simple language to access the properties

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe reassigned CAMEL-1656:
-----------------------------------

    Assignee: Ashwin Karpe

> Properties file component - And allow simple language to access the properties
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-1656
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1656
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: 2.3.0
>
>
> People using Spring XML as DSL is challenged with the fact they dont have a real programming language under the cover.
> And people do not want to hardcode values/options in the DSL directly. And spring property placeholder support is limited in what it can do.
> So we need for now our own properties component that can load a properties file from classpath. Leverage the spring resource endpoint that can do this.
> And let the simple language be able to access these properties as well so people can use it in expressions
> {code}
> <simple>${propertiesfile:foo:email}</simple>
> {code}
> And the properties file is could be define something like:
> {code}
> <endpoint id="foo" url="propertiesfile://META-INF/myprops.properties"/>
> {code}
> And the file content
> {code}
> email=someone@somewhere.org
> {code}
> Need to think a bit about how to define the properties file. If we can allow you to define it as a url or as a ref.
> For instance the simple expression could be:
> {code}
> <simple>${propertiesfile:classpath://META-INF/myprops.properties:email}</simple>
> {code}
> The above is for quick and dirty.

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