简体   繁体   English

如何在Kafka中创建用于延迟重发消息的结构

[英]How to create structure in Kafka for delay resending message in topic

Delay producing the message to the topic? 延迟向该主题发送消息? If not, will it appear soon? 如果没有,它将很快出现吗?

I have "NQueue" topic for sending differents notifications(Sms, Push, Transactions). 我有“ NQueue”主题,用于发送差异通知(Sms,Push,事务)。 I am trying turn a failed message(HttpRequest) back to queue with some delay. 我正在尝试将失败的消息(HttpRequest)延迟返回队列。

I have already re-read all the documentation and have not found this functionality. 我已经重新阅读了所有文档,但没有找到此功能。 If it does exist, or you know how to implement it, then write here, please. 如果确实存在,或者您知道如何实现,请在此处写下。

Like: 喜欢:

await producer.ProduceAsync(topic, message, delay);

Below I will attach a photo of my vision... 下面我将附上我的愿景的照片...

在此处输入图片说明

If you are considering the use of Kafka Stream , I would suggest to consider the option of using windowed aggregations . 如果您正在考虑使用Kafka Stream ,我建议考虑使用窗口聚合的选项。 In short, as follows: 简而言之,如下:

  • create a Kafka topic for failed messages 为失败的消息创建一个Kafka主题
  • build a Kafka Stream app with windowed aggregations to turn failed messages back to your queue (also be aware of an ability to suppress consecutive updates ). 使用窗口聚合构建一个Kafka Stream应用,以将失败的消息返回到您的队列(也要注意抑制连续更新的能力 )。 I assume that windowed aggregations will give you the opportunity to delay your failed messages. 我认为窗口聚合将为您提供延迟失败消息的机会。

In case streams are not suitable for you, look at the Dead Letter Queues 如果流不适合您,请查看死信队列

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

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