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] [Assigned] (CAMEL-3215) @PropertyInjected - An annotation to inject a property from Camel properties
Date Wed, 14 Aug 2013 10:52:49 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-3215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen reassigned CAMEL-3215:
----------------------------------

    Assignee: Claus Ibsen
    
> @PropertyInjected - An annotation to inject a property from Camel properties
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-3215
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3215
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: Future
>
>
> This is just an idea. Suppose you have a RouteBuilder in Java DSL and you need a timeout
value to be defined in a properties file
> {code}
> aggregateTimeout=20000
> {code}
> And then you want to use this timeout value in the RouteBuilder
> {code}
> from("xxx").aggregate(header("group"), myStrategy).completionTimeout(timeout).to("zzz");
> {code}
> The problem is that the DSL requires the timeout to be an integer because that makes
sense. So we can't use the property placeholder directly in the DSL as its a String type.
> eg. the following is *not* possible
> {code}
> from("xxx").aggregate(header("group"), myStrategy).completionTimeout("{{aggregationTimeout}}").to("zzz");
> {code}
> What we may need is to inject the timeout value in the RouteBuilder in a field
> {code}
> @PropertyInjected("aggregationTimeout")
> private int timeout;
> {code}
> The @PropertyInjected annotation tells Camel to go look for the aggregationTimeout property
and convert the value to the same type of the field, which is an int.
> Now you can use that value in the Java DSL
> There may be other or standard annotations/injections possible.
> Any though?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message