Is it possible to use the deadLetterChannel with REST DSL? I can't figure out how to have it use the deadLetterChannel if there is an exception thrown when calling another rest endpoint.
I have something along the lines of the below, but if there is an exception thrown at the to("https4://endpoint-uri")
, I would like to be able to have it go to the deadLetterChannel so I can write the data being processed to a database.
rest().description("Add meter reading.")
.post("/meter-reading")
.consumes(MediaType.APPLICATION_JSON_VALUE)
.produces(MediaType.APPLICATION_JSON_VALUE)
.route().routeId("addMeterReading")
.process(mileageProcessor)
.to("mustache:mustache/add-meter-reading.mustache")
.to("https4://endpoint-uri")
I tried using onException
, but the mustache component replaces the body containing the data with the template.
Thanks.
question from:
https://stackoverflow.com/questions/66054445/apache-camel-rest-dsl-deadletterchannel 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…