javaapache-camelsimple-el

How can I convert an Exchange property to uppercase in 'simple'?


How can I convert a property on an Apache Camel Exchange to uppercase, in Apache Camel expression language?

e.g.

.when(simple("${property.countryCode.toUpperCase} regex 'NO?'"))

But I am getting:

org.apache.camel.language.bean.RuntimeBeanExpressionException:
Failed to invoke method: .toUpperCase on null

I have verified that my property does in fact exist via .log("${property.countryCode}").

This shouldn't be so hard, to get toUpperCase in Apache Simple (but it is).

I don't want to have to do toUpperCase in Java, or Groovy, or whatever - there must be an easier way


Solution

  • Try

    .when(simple("${property.countryCode.toUpperCase()} regex 'NO?'"))