camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Resolved] (CAMEL-3215) @PropertyInjected - An annotation to inject a property from Camel properties
Date Mon, 26 Aug 2013 12:32:52 GMT


Claus Ibsen resolved CAMEL-3215.

    Resolution: Fixed

There is now a new @ProjectInject. See details at the using property placeholder doc page.
> @PropertyInjected - An annotation to inject a property from Camel properties
> ----------------------------------------------------------------------------
>                 Key: CAMEL-3215
>                 URL:
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.12.0
> 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:

View raw message