Guest User

Untitled

a guest
Oct 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. {
  2. "orderId": "315973",
  3. "status": "Complete",
  4. "entity": {
  5. ...
  6. }
  7.  
  8. // Unimportant part
  9. from("direct:in")
  10. .setHeader(Exchange.HTTP_METHOD, constant("POST"))
  11. .setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
  12. .setHeader("Authorization", simple(AUTH_TOKEN))
  13. .to(SOME_ENDPOINT_1).bean(ResultIDExtractorBean.class)
  14. .to(SOME_ENDPOINT_2).bean(OrderIDExtractorBean.class)
  15. .to(SOME_ENDPOINT_3)
  16. .choice()
  17. // Important part
  18. .when().jsonpath("$[?(@.status == 'Complete')]" , false)
  19. .to("mock:complete")
  20. .when().jsonpath("$[?(@.status == 'In Progress')]" , false)
  21. .to("mock:in_progress")
  22. .otherwise()
  23. .to("mock:error").stop()
  24. .end();
Add Comment
Please, Sign In to add comment