I am using Apache Camel to expose an internal REST endpoint. The internal endpoint returns code 400 (BAD REQUEST), alongside with useful JSON with error details.
By default, Camel reacts by returning code 500. How can I get Camel to pass on code 400 with its accompanying JSON body?
Camel route:
rest("/internal")
.post("/getServiceState")
.to("direct:getServiceState");
from("direct:getServiceState")
.to("http://endpoint/getServiceState" + "?bridgeEndpoint=true");