Jericho
Jericho

Reputation: 10953

SimpleIllegalSyntaxException: is operator cannot find class with name:

I am trying to check camel choice condition in when with calling the method but which is failing and throws exception.Please help me to check the method return value with constant value.

Exception:

SimpleIllegalSyntaxException: is operator cannot find class with name: VS at location 22 ${body.recType} is 'VS'

Route:

from("direct:processAccounts").process(filterProcessor). 
 split(simple("${body}")).choice().when().
 simple("${body.recType} is 'VS'").
 process((exchange) -> {log.info("VS:");}).otherwise().to("stream:out");

Java Class:

public class Records{

    private String recType;
    // getters and setters
}

Upvotes: 0

Views: 302

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55555

The is operator is like instanceof in Java. If you want to do an equals comparison on the string value, then use

simple("${body.recType} == 'VS'").

See the simple documentation: http://camel.apache.org/simple

Upvotes: 1

Related Questions