How to do custom error handling in an apache camel rest api?

前端 未结 1 1707
北荒
北荒 2021-01-28 15:00

I have an apache camel rest api which downloads a file from S3. I send json input(key, bucketname, accessKey, secretKey, region) in order to write the URI. The code

相关标签:
1条回答
  • 2021-01-28 15:58

    You need to use "onException" clause and create your own response in a processor there. See: https://camel.apache.org/manual/latest/exception-clause.html

    onException(TheThrownException.class)
        .handled(...) //--> depend on your need true or false
        .continued(...) //--> depend on your need true or false
        .process("processor1")
        .to("direct:error-handling-endpoint")
    
    0 讨论(0)
提交回复
热议问题