Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "orderId": "315973",
- "status": "Complete",
- "entity": {
- ...
- }
- // Unimportant part
- from("direct:in")
- .setHeader(Exchange.HTTP_METHOD, constant("POST"))
- .setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
- .setHeader("Authorization", simple(AUTH_TOKEN))
- .to(SOME_ENDPOINT_1).bean(ResultIDExtractorBean.class)
- .to(SOME_ENDPOINT_2).bean(OrderIDExtractorBean.class)
- .to(SOME_ENDPOINT_3)
- .choice()
- // Important part
- .when().jsonpath("$[?(@.status == 'Complete')]" , false)
- .to("mock:complete")
- .when().jsonpath("$[?(@.status == 'In Progress')]" , false)
- .to("mock:in_progress")
- .otherwise()
- .to("mock:error").stop()
- .end();
Add Comment
Please, Sign In to add comment