기본적으로 jsonpath는 구성된 jsonpath 표현식에 따라 JSON 페이로드에 유효한 경로가 없는 경우 예외를 throw합니다. 일부 사용 사례에서는 json 페이로드에 선택적 데이터가 포함되어 있는 경우 이를 무시해야 할 수 있습니다. 따라서 다음과 같이 이를 무시하려면 suppressExceptions 를 true 로 설정할 수 있습니다.
from("direct:start")
.choice()
// use true to suppress exceptions
.when().jsonpath("person.middlename", true)
.to("mock:middle")
.otherwise()
.to("mock:other");
from("direct:start")
.choice()
// use true to suppress exceptions
.when().jsonpath("person.middlename", true)
.to("mock:middle")
.otherwise()
.to("mock:other");
Copy to ClipboardCopied!Toggle word wrapToggle overflow