【发布时间】:2021-10-11 19:36:44
【问题描述】:
我正在使用 Apache Camel 来公开一个内部 REST 端点。 内部端点返回代码 400(错误请求)以及带有错误详细信息的有用 JSON。
默认情况下,Camel 通过返回代码 500 做出反应。如何让 Camel 传递代码 400 及其随附的 JSON 正文?
骆驼路线:
rest("/internal")
.post("/getServiceState")
.to("direct:getServiceState");
from("direct:getServiceState")
.to("http://endpoint/getServiceState" + "?bridgeEndpoint=true");
【问题讨论】:
标签: java error-handling apache-camel