http请求失败如何让消息返回队列?

How to get the message back to the queue if the http request failed?

我将 apache camel 与 activemq 和 camel-http 一起使用,消息发送到端点并且请求失败后,我仍然从队列中丢失消息。 如果请求失败,消息不丢失是必要的。我该怎么做?

<route>
<from uri="activemq://db_record_rows"/>
<to uri="http://localhost:3000" />
</route>

您可以将您的消费者标记为已交易,这样它将由您上下文的交易管理器处理。

from("activemq://db_record_rows?transacted=true")
.to("http://localhost:3000")