java SimpleAllegalSyntaxException:is运算符找不到名称为的类:
我试图通过调用该方法来检查when
中的骆驼选择条件,但该方法失败并引发异常。请帮我用常量值检查方法返回值
例外情况:
SimpleIllegalSyntaxException: is operator cannot find class with name: VS at location 22 ${body.recType} is 'VS'
路线:
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类:
public class Records{
private String recType;
// getters and setters
}
# 1 楼答案
is
操作符类似于Java中的instanceof
。如果要对字符串值进行等于比较,请使用请参阅简单文档:http://camel.apache.org/simple