<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>消息队列 on Kevin&#39;s Blog</title>
    <link>https://kevin4dev.pages.dev/tags/%E6%B6%88%E6%81%AF%E9%98%9F%E5%88%97/</link>
    <description>Recent content in 消息队列 on Kevin&#39;s Blog</description>
    <generator>Hugo -- 0.147.9</generator>
    <language>zh</language>
    <lastBuildDate>Mon, 02 Feb 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://kevin4dev.pages.dev/tags/%E6%B6%88%E6%81%AF%E9%98%9F%E5%88%97/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Clouflare Queue</title>
      <link>https://kevin4dev.pages.dev/post/cloudflare-queues/</link>
      <pubDate>Mon, 02 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://kevin4dev.pages.dev/post/cloudflare-queues/</guid>
      <description>&lt;h2 id=&#34;是什么&#34;&gt;是什么&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;是 Cloudflare的消息队列&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;目的&#34;&gt;目的&lt;/h3&gt;
&lt;p&gt;解耦、削峰、异步化&lt;/p&gt;
&lt;h3 id=&#34;优势&#34;&gt;优势&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;至少一次（at-least-once）投递&lt;/li&gt;
&lt;li&gt;批处理/重试/延迟&lt;/li&gt;
&lt;li&gt;死信队列（DLQ）&lt;/li&gt;
&lt;li&gt;不收 egress 带宽费&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;解决了什么问题&#34;&gt;解决了什么问题&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;把重活从请求链路“挪走”：HTTP 请求先快速返回，把耗时任务（发邮件、写数据库、调用第三方 API、生成任务等）丢进队列慢慢处理，避免超时与抖动。&lt;/li&gt;
&lt;li&gt;削峰填谷：流量突刺时先入队，消费者按可控并发/批量处理，防止下游（DB / 第三方）被打爆。&lt;/li&gt;
&lt;li&gt;可靠性：失败自动重试，超过重试上限可进 DLQ 便于排查（否则达到上限会被删除）。&lt;/li&gt;
&lt;li&gt;Workers 之外也能消费：支持 pull consumer，外部服务用 HTTP 拉取并 ack（注意是短轮询）。&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
  </channel>
</rss>
