简体   繁体   English

Apache Camel内存中死信队列

[英]Apache Camel in-memory dead letter queue

I am looking for a simple delayed retried delivery on my camel route. 我正在寻找骆驼路线上的简单延误重试交货。 I have configured 我已经配置

from("rss:" + rssUrl + "?splitEntries=false&delay=15s").bean(rssHandler) .onException(ConnectException.class).redeliveryDelay(10000).backOffMultiplier(2).maximumRedeliveries(5);

on my route, but after seeing that it did not work I learned that I must configure a dead letter channel, otherwise this configuration is ignored basically. 在我的路线上,但是在看到它不起作用后,我得知必须配置一个死信通道,否则基本上将忽略此配置。

So I added: 所以我补充说:

errorHandler(deadLetterChannel("log:error"));

to my Java Camel config, however, I am looking for the simplest possible dead letter channel implementation that does not require me to pull in say ActiveMQ or anything like that, I'd be happy with a simple memory-based retry mechanism with no guarantees. 但是,对于我的Java Camel配置,我正在寻找最简单的死信通道实现,该实现不需要我说ActiveMQ或类似的东西,我对没有保证的基于内存的简单重试机制感到满意。 Unfortunately, I haven't found any so far, so reaching out to here if anyone can help me pointing to a simple way to configure retries with some minimal dead letter channel component. 不幸的是,到目前为止我还没有找到任何东西,因此如果有人可以帮助我,请访问这里,提出一种简单的方法来使用最少的死信通道组件配置重试。

Using a seda component instead of a log component can give you an in-memory dead letter destination. 使用seda组件而不是日志组件可以为您提供内存中的死信目的地。 Eg replace "log" with "seda". 例如,将“ log”替换为“ seda”。 However, keep in mind that once the re-deliveries are exhausted, the message will live in this queue, and hence in memory unless there is a process de-queuing it or purging messages older than specified time period configured for this queue. 但是,请记住,一旦重新交付用尽,该消息将存在于此队列中,因此将存在于内存中,除非有进程将其取消排队或清除早于为此队列配置的指定时间段的消息。

https://camel.apache.org/dead-letter-channel.html https://camel.apache.org/dead-letter-channel.html

You can also, just configure your config to mark the exception as handled and give up on the message once the max re-delivery count is reached 您还可以只配置您的配置,以将异常标记为已处理,并在达到最大重新发送次数后放弃该消息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM