如何在 http 请求失败时将消息返回到队列



我将 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")

最新更新