You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by SHTherkildsen <So...@Systematic.com> on 2016/02/26 16:38:58 UTC

Using spring BridgePropertyPlaceholderConfigurer

Hi.

I have started using BridgePropertyPlaceholderConfigurer to bridge Spring
and Camel property placeholders.

However, when using log statements like the one below in a camel route I now
get errors because the BridgePropertyPlaceholderConfigurer expects ${body}
to be a spring placeholder. 

log statement:

     .log(LoggingLevel.DEBUG, "Request '${body}' sent to queue:
{{LOOKUP_CITIZEN_QUEUE_TO}}")

Do any of you know of a good workaround to log the body of the exchange,
when I can no longer use ${body} in log statements?

Stacktrace snippet:

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder
'body' in string value "Request '${body}' sent to queue: lookup_citizen"
	at
org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
	at
org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
	at
org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer.springResolvePlaceholders(BridgePropertyPlaceholderConfigurer.java:207)



--
View this message in context: http://camel.465427.n5.nabble.com/Using-spring-BridgePropertyPlaceholderConfigurer-tp5778327.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using spring BridgePropertyPlaceholderConfigurer

Posted by Claus Ibsen <cl...@gmail.com>.
You can use the simple alternative syntax
http://camel.apache.org/simple

On Fri, Feb 26, 2016 at 4:38 PM, SHTherkildsen
<So...@systematic.com> wrote:
> Hi.
>
> I have started using BridgePropertyPlaceholderConfigurer to bridge Spring
> and Camel property placeholders.
>
> However, when using log statements like the one below in a camel route I now
> get errors because the BridgePropertyPlaceholderConfigurer expects ${body}
> to be a spring placeholder.
>
> log statement:
>
>      .log(LoggingLevel.DEBUG, "Request '${body}' sent to queue:
> {{LOOKUP_CITIZEN_QUEUE_TO}}")
>
> Do any of you know of a good workaround to log the body of the exchange,
> when I can no longer use ${body} in log statements?
>
> Stacktrace snippet:
>
> Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder
> 'body' in string value "Request '${body}' sent to queue: lookup_citizen"
>         at
> org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
>         at
> org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
>         at
> org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer.springResolvePlaceholders(BridgePropertyPlaceholderConfigurer.java:207)
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-spring-BridgePropertyPlaceholderConfigurer-tp5778327.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2