You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rsteppac2 <ra...@steppacher.name> on 2015/04/15 11:34:02 UTC

Simple expression not evaluated in Spring DSL setProperty

Hello all,

is this supposed to work?

<setProperty
propertyName="$simple{type:my.domain.StringConstants.EXCHANGE_PROP_TX_FAILED}">
	<simple>${type:java.lang.Boolean.TRUE}</simple>
</setProperty>

StringConstants.EXCHANGE_PROP_TX_FAILED := "exchange_prop_tx_failed"

The property name is not evaluated to the string "exchange_prop_tx_failed".
Instead the expression is used verbatim as the property name. 
The property value is evaluated to Boolean.TRUE as expected.

Using <log
message="$simple{type:my.domain.StringConstants.EXCHANGE_PROP_TX_FAILED}"...>
prints the expected value "exchange_prop_tx_failed" to the log.


Ralf



--
View this message in context: http://camel.465427.n5.nabble.com/Simple-expression-not-evaluated-in-Spring-DSL-setProperty-tp5765820.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Simple expression not evaluated in Spring DSL setProperty

Posted by rsteppac2 <ra...@steppacher.name>.
Claus, thanks for clarifying.

Ralf



--
View this message in context: http://camel.465427.n5.nabble.com/Simple-expression-not-evaluated-in-Spring-DSL-setProperty-tp5765820p5765847.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Simple expression not evaluated in Spring DSL setProperty

Posted by Claus Ibsen <cl...@gmail.com>.
You cannot use dynamic values in the headerName / propertyName.

On Wed, Apr 15, 2015 at 11:34 AM, rsteppac2 <ra...@steppacher.name> wrote:
> Hello all,
>
> is this supposed to work?
>
> <setProperty
> propertyName="$simple{type:my.domain.StringConstants.EXCHANGE_PROP_TX_FAILED}">
>         <simple>${type:java.lang.Boolean.TRUE}</simple>
> </setProperty>
>
> StringConstants.EXCHANGE_PROP_TX_FAILED := "exchange_prop_tx_failed"
>
> The property name is not evaluated to the string "exchange_prop_tx_failed".
> Instead the expression is used verbatim as the property name.
> The property value is evaluated to Boolean.TRUE as expected.
>
> Using <log
> message="$simple{type:my.domain.StringConstants.EXCHANGE_PROP_TX_FAILED}"...>
> prints the expected value "exchange_prop_tx_failed" to the log.
>
>
> Ralf
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Simple-expression-not-evaluated-in-Spring-DSL-setProperty-tp5765820.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/