djb
djb

Reputation: 1674

Camel property placeholder boolean

I have a property in my property file:

glob.dev_environment=true

or

glob.dev_environment=false

Now I've tried the following:

<route id="emailMonitor" autoStartup="${!glob.dev_environment}">
    <from uri="{{imapURL}}" />
    <bean ref="attachmentProcessor"/>
</route>  

<route id="emailMonitor" autoStartup="${not glob.dev_environment}">
    <from uri="{{imapURL}}" />
    <bean ref="attachmentProcessor"/>
</route>  

<route id="emailMonitor" autoStartup="{{!glob.dev_environment}}">
    <from uri="{{imapURL}}" />
    <bean ref="attachmentProcessor"/>
</route>  

<route id="emailMonitor" autoStartup="{{not glob.dev_environment}}">
    <from uri="{{imapURL}}" />
    <bean ref="attachmentProcessor"/>
</route>  

<route id="emailMonitor" autoStartup="{{glob.dev_environment == 'false'}}">
    <from uri="{{imapURL}}" />
    <bean ref="attachmentProcessor"/>
</route>  

<route id="emailMonitor" prop:autoStartup="!glob.dev_environment">
    <from uri="{{imapURL}}" />
    <bean ref="attachmentProcessor"/>
</route>  

I'm going a bit crazy here. How do I get it to evaluate a boolean in XML DSL? Yes, I've read this section, and this section. I bet changing to glob.prod_environment would make this easier, because the XML DSL probably can't handle boolean operations. Am I right? Is that what's going on?

Upvotes: 0

Views: 558

Answers (1)

djb
djb

Reputation: 1674

As per comments above...

Camel property value negation only works in v3.x. The prop: prefix doesn't seem to work in v2.x either.

Workaround solution was to use a property that didn't require negation.

Upvotes: 1

Related Questions