cloudflare-queues

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cloudflare Queues

Cloudflare Queues

Status: Production Ready ✅ | Last Verified: 2025-12-27
Dependencies: cloudflare-worker-base (for Worker setup)

状态: Production Ready ✅ | 最后验证时间: 2025-12-27
依赖项: cloudflare-worker-base(用于Worker部署)

Quick Start (10 Minutes)

快速入门(10分钟)

1. Create Queue

1. 创建队列

bash
bunx wrangler queues create my-queue
bunx wrangler queues list
bash
bunx wrangler queues create my-queue
bunx wrangler queues list

2. Producer (Send Messages)

2. 生产者(发送消息)

wrangler.jsonc:
jsonc
{
  "name": "my-producer",
  "main": "src/index.ts",
  "queues": {
    "producers": [
      {
        "binding": "MY_QUEUE",
        "queue": "my-queue"
      }
    ]
  }
}
src/index.ts:
typescript
import { Hono } from 'hono';

type Bindings = {
  MY_QUEUE: Queue;
};

const app = new Hono<{ Bindings: Bindings }>();

app.post('/send', async (c) => {
  await c.env.MY_QUEUE.send({
    userId: '123',
    action: 'process-order',
    timestamp: Date.now(),
  });

  return c.json({ status: 'queued' });
});

export default app;
wrangler.jsonc:
jsonc
{
  "name": "my-producer",
  "main": "src/index.ts",
  "queues": {
    "producers": [
      {
        "binding": "MY_QUEUE",
        "queue": "my-queue"
      }
    ]
  }
}
src/index.ts:
typescript
import { Hono } from 'hono';

type Bindings = {
  MY_QUEUE: Queue;
};

const app = new Hono<{ Bindings: Bindings }>();

app.post('/send', async (c) => {
  await c.env.MY_QUEUE.send({
    userId: '123',
    action: 'process-order',
    timestamp: Date.now(),
  });

  return c.json({ status: 'queued' });
});

export default app;

3. Consumer (Process Messages)

3. 消费者(处理消息)

wrangler.jsonc:
jsonc
{
  "name": "my-consumer",
  "main": "src/consumer.ts",
  "queues": {
    "consumers": [
      {
        "queue": "my-queue",
        "max_batch_size": 10,
        "max_retries": 3,
        "dead_letter_queue": "my-dlq"
      }
    ]
  }
}
src/consumer.ts:
typescript
import type { MessageBatch } from '@cloudflare/workers-types';

export default {
  async queue(batch: MessageBatch): Promise<void> {
    for (const message of batch.messages) {
      console.log('Processing:', message.body);
      // Your logic here
    }
    // Implicit ack: returning successfully acknowledges all messages
  },
};
Deploy:
bash
bunx wrangler deploy
Load:
references/setup-guide.md
for complete 6-step setup with DLQ configuration

wrangler.jsonc:
jsonc
{
  "name": "my-consumer",
  "main": "src/consumer.ts",
  "queues": {
    "consumers": [
      {
        "queue": "my-queue",
        "max_batch_size": 10,
        "max_retries": 3,
        "dead_letter_queue": "my-dlq"
      }
    ]
  }
}
src/consumer.ts:
typescript
import type { MessageBatch } from '@cloudflare/workers-types';

export default {
  async queue(batch: MessageBatch): Promise<void> {
    for (const message of batch.messages) {
      console.log('Processing:', message.body);
      // 此处添加你的业务逻辑
    }
    // 隐式确认:成功返回即确认所有消息
  },
};
部署:
bash
bunx wrangler deploy
加载完整指南:
references/setup-guide.md
获取包含DLQ配置的6步完整部署流程

Critical Rules

关键规则

Always Do ✅

务必遵循 ✅

  1. Configure Dead Letter Queue for production queues
  2. Use explicit ack() for non-idempotent operations (DB writes, API calls)
  3. Validate message size before sending (<128 KB)
  4. Use sendBatch() for multiple messages (more efficient)
  5. Implement exponential backoff for retries
  6. Set appropriate batch settings based on workload
  7. Monitor queue backlog and consumer errors
  8. Use ctx.waitUntil() for async cleanup in consumers
  9. Handle errors gracefully - log, alert, retry
  10. Let concurrency auto-scale (don't set max_concurrency unless needed)
  1. 为生产环境队列配置死信队列(Dead Letter Queue)
  2. 对非幂等操作(数据库写入、API调用)使用显式ack()
  3. 发送前验证消息大小(<128 KB)
  4. 批量发送消息使用sendBatch()(更高效)
  5. 为重试实现指数退避策略
  6. 根据工作负载设置合适的批量参数
  7. 监控队列积压和消费者错误
  8. 在消费者中使用ctx.waitUntil()处理异步清理
  9. 优雅处理错误 - 记录日志、发送告警、重试
  10. 让并发自动扩容(除非必要,不要设置max_concurrency)

Never Do ❌

切勿操作 ❌

  1. Never assume message ordering - not guaranteed FIFO
  2. Never rely on implicit ack for non-idempotent ops - use explicit ack()
  3. Never send messages >128 KB - will fail
  4. Never delete queues with active messages - data loss
  5. Never skip DLQ configuration in production
  6. Never exceed 5000 msg/s per queue - rate limit error
  7. Never process messages synchronously in loop - use Promise.all()
  8. Never ignore message.attempts - use for backoff logic
  9. Never set max_concurrency=1 unless you have a very specific reason
  10. Never forget to ack() in explicit acknowledgement patterns

  1. 不要假设消息顺序 - 不保证FIFO(先进先出)
  2. 不要依赖隐式确认处理非幂等操作 - 使用显式ack()
  3. 不要发送超过128 KB的消息 - 会发送失败
  4. 不要删除包含活跃消息的队列 - 会导致数据丢失
  5. 生产环境切勿跳过DLQ配置
  6. 不要超过队列每秒5000条消息的限制 - 会触发速率限制错误
  7. 不要在循环中同步处理消息 - 使用Promise.all()
  8. 不要忽略message.attempts字段 - 用于退避逻辑
  9. 不要将max_concurrency设置为1,除非有非常特殊的需求
  10. 在显式确认模式下切勿忘记调用ack()

Top 3 Critical Errors

三大严重错误

Error #1: Message Too Large

错误1:消息过大

Problem: Message exceeds 128 KB limit
Solution: Store large data in R2, send reference
typescript
// ❌ Wrong
await env.MY_QUEUE.send({ data: largeArray }); // >128 KB fails

// ✅ Correct
const message = { data: largeArray };
const size = new TextEncoder().encode(JSON.stringify(message)).length;

if (size > 128000) {
  const key = `messages/${crypto.randomUUID()}.json`;
  await env.MY_BUCKET.put(key, JSON.stringify(message));
  await env.MY_QUEUE.send({ type: 'large-message', r2Key: key });
} else {
  await env.MY_QUEUE.send(message);
}
问题: 消息超过128 KB限制
解决方案: 将大数据存储在R2中,仅发送引用
typescript
// ❌ 错误做法
await env.MY_QUEUE.send({ data: largeArray }); // >128 KB 会失败

// ✅ 正确做法
const message = { data: largeArray };
const size = new TextEncoder().encode(JSON.stringify(message)).length;

if (size > 128000) {
  const key = `messages/${crypto.randomUUID()}.json`;
  await env.MY_BUCKET.put(key, JSON.stringify(message));
  await env.MY_QUEUE.send({ type: 'large-message', r2Key: key });
} else {
  await env.MY_QUEUE.send(message);
}

Error #2: Throughput Exceeded

错误2:吞吐量超出限制

Problem: Exceeding 5000 messages/second per queue
Solution: Use sendBatch() and rate limiting
typescript
// ❌ Wrong
for (let i = 0; i < 10000; i++) {
  await env.MY_QUEUE.send({ id: i }); // Too fast!
}

// ✅ Correct
const messages = Array.from({ length: 10000 }, (_, i) => ({
  body: { id: i },
}));

// Send in batches of 100
for (let i = 0; i < messages.length; i += 100) {
  await env.MY_QUEUE.sendBatch(messages.slice(i, i + 100));
}
问题: 超过队列每秒5000条消息的限制
解决方案: 使用sendBatch()和速率限制
typescript
// ❌ 错误做法
for (let i = 0; i < 10000; i++) {
  await env.MY_QUEUE.send({ id: i }); // 速度过快!
}

// ✅ 正确做法
const messages = Array.from({ length: 10000 }, (_, i) => ({
  body: { id: i },
}));

// 按每批100条发送
for (let i = 0; i < messages.length; i += 100) {
  await env.MY_QUEUE.sendBatch(messages.slice(i, i + 100));
}

Error #3: Entire Batch Retried When One Message Fails

错误3:单条消息失败导致整批重试

Problem: Single message failure causes all messages to retry
Solution: Use explicit acknowledgement
typescript
// ❌ Wrong - implicit ack
export default {
  async queue(batch: MessageBatch, env: Env): Promise<void> {
    for (const message of batch.messages) {
      await env.DB.prepare('INSERT INTO orders VALUES (?, ?)').bind(
        message.body.id,
        message.body.amount
      ).run();
    }
    // If any fails, ALL retry!
  },
};

// ✅ Correct - explicit ack
export default {
  async queue(batch: MessageBatch, env: Env): Promise<void> {
    for (const message of batch.messages) {
      try {
        await env.DB.prepare('INSERT INTO orders VALUES (?, ?)').bind(
          message.body.id,
          message.body.amount
        ).run();

        message.ack(); // Only ack on success
      } catch (error) {
        console.error(`Failed: ${message.id}`, error);
        // Don't ack - will retry independently
      }
    }
  },
};
Load
references/error-catalog.md
for all 10 errors including DLQ configuration, auto-scaling issues, message deletion prevention, and detailed solutions.

问题: 单条消息失败会导致整批消息重试
解决方案: 使用显式确认机制
typescript
// ❌ 错误做法 - 隐式确认
export default {
  async queue(batch: MessageBatch, env: Env): Promise<void> {
    for (const message of batch.messages) {
      await env.DB.prepare('INSERT INTO orders VALUES (?, ?)').bind(
        message.body.id,
        message.body.amount
      ).run();
    }
    // 若任意一条失败,所有消息都会重试!
  },
};

// ✅ 正确做法 - 显式确认
export default {
  async queue(batch: MessageBatch, env: Env): Promise<void> {
    for (const message of batch.messages) {
      try {
        await env.DB.prepare('INSERT INTO orders VALUES (?, ?)').bind(
          message.body.id,
          message.body.amount
        ).run();

        message.ack(); // 仅在成功时确认
      } catch (error) {
        console.error(`处理失败: ${message.id}`, error);
        // 不确认 - 会独立重试
      }
    }
  },
};
加载完整错误指南:
references/error-catalog.md
获取包含DLQ配置、自动扩容问题、消息删除预防等在内的10类错误及详细解决方案。

Common Use Cases

常见用例

Use Case 1: Basic Message Queue

用例1:基础消息队列

When: Simple async job processing (emails, notifications)
Quick Pattern:
typescript
// Producer
await env.MY_QUEUE.send({ type: 'email', to: 'user@example.com' });

// Consumer (implicit ack - for idempotent operations)
export default {
  async queue(batch: MessageBatch): Promise<void> {
    for (const message of batch.messages) {
      await sendEmail(message.body.to, message.body.content);
    }
  },
};
Load:
templates/queues-producer.ts
+
templates/queues-consumer-basic.ts
适用场景: 简单异步任务处理(邮件、通知)
快速实现模式:
typescript
// 生产者
await env.MY_QUEUE.send({ type: 'email', to: 'user@example.com' });

// 消费者(隐式确认 - 适用于幂等操作)
export default {
  async queue(batch: MessageBatch): Promise<void> {
    for (const message of batch.messages) {
      await sendEmail(message.body.to, message.body.content);
    }
  },
};
加载模板:
templates/queues-producer.ts
+
templates/queues-consumer-basic.ts

Use Case 2: Database Writes (Non-Idempotent)

用例2:数据库写入(非幂等操作)

When: Writing to database, must avoid duplicates
Load:
templates/queues-consumer-explicit-ack.ts
+
references/consumer-api.md
适用场景: 写入数据库,必须避免重复数据
加载资源:
templates/queues-consumer-explicit-ack.ts
+
references/consumer-api.md

Use Case 3: Retry with Exponential Backoff

用例3:指数退避重试

When: Calling rate-limited APIs, temporary failures
Load:
templates/queues-retry-with-delay.ts
+
references/error-catalog.md
(Error #2, #3)
适用场景: 调用有限流的API、临时故障场景
加载资源:
templates/queues-retry-with-delay.ts
+
references/error-catalog.md
(错误2、3)

Use Case 4: Dead Letter Queue Pattern

用例4:死信队列模式

When: Production systems, need to capture permanently failed messages
Load:
templates/queues-dlq-pattern.ts
+
references/setup-guide.md
(Step 4)
适用场景: 生产系统,需要捕获永久失败的消息
加载资源:
templates/queues-dlq-pattern.ts
+
references/setup-guide.md
(步骤4)

Use Case 5: High Throughput Processing

用例5:高吞吐量处理

When: Processing thousands of messages per second
Quick Pattern:
jsonc
{
  "queues": {
    "consumers": [{
      "queue": "my-queue",
      "max_batch_size": 100,        // Large batches
      "max_batch_timeout": 5,       // Fast processing
      "max_concurrency": null       // Auto-scale
    }]
  }
}
Load:
references/best-practices.md
→ Optimizing Throughput

适用场景: 每秒处理数千条消息
快速配置模式:
jsonc
{
  "queues": {
    "consumers": [{
      "queue": "my-queue",
      "max_batch_size": 100,        // 大批次
      "max_batch_timeout": 5,       // 快速处理
      "max_concurrency": null       // 自动扩容
    }]
  }
}
加载指南:
references/best-practices.md
→ 吞吐量优化

When to Load References

何时加载参考文档

Load
references/setup-guide.md
when
:
  • User needs complete setup walkthrough (queue → producer → consumer → DLQ)
  • First time setting up Cloudflare Queues
  • Need production configuration examples
  • Want complete end-to-end example
Load
references/error-catalog.md
when
:
  • Encountering any of the 10 documented errors
  • Troubleshooting queue issues
  • Messages not being delivered/processed
  • Need prevention checklist
Load
references/producer-api.md
when
:
  • Need complete producer API reference
  • Using send() or sendBatch() methods
  • Need message format specifications
  • Handling large messages or batches
Load
references/consumer-api.md
when
:
  • Need complete consumer API reference
  • Using explicit ack(), retry(), or retryAll()
  • Need batch processing patterns
  • Implementing complex consumer logic
Load
references/best-practices.md
when
:
  • Optimizing queue performance
  • Production deployment guidance
  • Monitoring and observability setup
  • Security and reliability patterns
Load
references/wrangler-commands.md
when
:
  • Need CLI commands reference
  • Managing queues (create, delete, list)
  • Controlling delivery (pause, resume)
  • Debugging queue issues
  • Real-time monitoring and performance analysis
Load
references/typescript-types.md
when
:
  • Need complete TypeScript type definitions
  • Working with Queue, MessageBatch, or Message interfaces
  • Implementing type-safe producers or consumers
  • Using generic types for message bodies
  • Need type guards for message validation
Load
references/production-checklist.md
when
:
  • Preparing for production deployment
  • Need pre-deployment verification checklist
  • Want detailed explanations of production best practices
  • Setting up monitoring, DLQ, or error handling
  • Planning load testing or security review
Load
references/pull-consumers.md
when
:
  • Need to consume messages from non-Workers environments
  • Integrating with existing backend services (Node.js, Python, Go)
  • Implementing pull-based polling instead of push-based consumption
  • Working with containerized or legacy applications
Load
references/http-publishing.md
when
:
  • Publishing messages from external systems via HTTP
  • Integrating webhooks from third-party services
  • Need to send messages without deploying Workers
  • Implementing CI/CD pipeline notifications
Load
references/r2-event-integration.md
when
:
  • Triggering queue messages on R2 bucket events
  • Implementing automated image/document processing
  • Setting up event-driven data pipelines
  • Need R2 object upload/delete notifications

当以下情况时加载
references/setup-guide.md
:
  • 用户需要完整部署流程(队列→生产者→消费者→DLQ)
  • 首次设置Cloudflare Queues
  • 需要生产环境配置示例
  • 需要完整端到端示例
当以下情况时加载
references/error-catalog.md
:
  • 遇到任何文档中记录的10类错误
  • 排查队列问题
  • 消息未投递/未处理
  • 需要错误预防检查表
当以下情况时加载
references/producer-api.md
:
  • 需要完整生产者API参考
  • 使用send()或sendBatch()方法
  • 需要消息格式规范
  • 处理大消息或批量消息
当以下情况时加载
references/consumer-api.md
:
  • 需要完整消费者API参考
  • 使用显式ack()、retry()或retryAll()
  • 需要批量处理模式
  • 实现复杂消费者逻辑
当以下情况时加载
references/best-practices.md
:
  • 优化队列性能
  • 生产环境部署指导
  • 监控与可观测性配置
  • 安全与可靠性模式
当以下情况时加载
references/wrangler-commands.md
:
  • 需要CLI命令参考
  • 管理队列(创建、删除、列表)
  • 控制消息投递(暂停、恢复)
  • 调试队列问题
  • 实时监控与性能分析
当以下情况时加载
references/typescript-types.md
:
  • 需要完整TypeScript类型定义
  • 处理Queue、MessageBatch或Message接口
  • 实现类型安全的生产者或消费者
  • 为消息体使用泛型
  • 需要消息验证的类型守卫
当以下情况时加载
references/production-checklist.md
:
  • 准备生产环境部署
  • 需要预部署验证检查表
  • 需要生产最佳实践的详细说明
  • 配置监控、DLQ或错误处理
  • 规划负载测试或安全评审
当以下情况时加载
references/pull-consumers.md
:
  • 需要从非Workers环境消费消息
  • 与现有后端服务(Node.js、Python、Go)集成
  • 实现拉取式轮询而非推送式消费
  • 处理容器化或遗留应用
当以下情况时加载
references/http-publishing.md
:
  • 通过HTTP从外部系统发布消息
  • 集成第三方服务的Webhook
  • 需要无需部署Workers即可发送消息
  • 实现CI/CD流水线通知
当以下情况时加载
references/r2-event-integration.md
:
  • 在R2存储桶事件触发队列消息
  • 实现自动化图片/文档处理
  • 配置事件驱动的数据流水线
  • 需要R2对象上传/删除通知

Agents & Commands

Agent与命令

Available Agents:
  • queue-debugger - 9-phase diagnostic analysis for queue issues (systematic troubleshooting)
  • queue-optimizer - Performance tuning and cost optimization (batch size, concurrency, retries)
Available Commands:
  • /queue-setup - Interactive wizard for complete queue setup
  • /queue-troubleshoot - Quick diagnostic for common issues
  • /queue-monitor - Real-time metrics and status display

可用Agent:
  • queue-debugger - 针对队列问题的9阶段诊断分析(系统化排查)
  • queue-optimizer - 性能调优与成本优化(批量大小、并发、重试)
可用命令:
  • /queue-setup - 完整队列部署的交互式向导
  • /queue-troubleshoot - 常见问题快速诊断
  • /queue-monitor - 实时指标与状态展示

Limits & Quotas

限制与配额

Critical limits:
  • Message size: 128 KB max per message
  • Throughput: 5,000 messages/second per queue
  • Batch size: 100 messages max per sendBatch()
  • Consumer CPU time: 30 seconds (default), 300 seconds (max with config)
  • Max retries: Configurable (default 3)
  • Queue name: Max 63 characters, lowercase/numbers/hyphens
Load
references/best-practices.md
for handling limits and optimization strategies.

关键限制:
  • 消息大小: 单条消息最大128 KB
  • 吞吐量: 每个队列每秒最多5000条消息
  • 批量大小: sendBatch()最多100条消息
  • 消费者CPU时间: 默认30秒,配置后最大300秒
  • 最大重试次数: 可配置(默认3次)
  • 队列名称: 最多63个字符,仅允许小写字母/数字/连字符
加载优化指南:
references/best-practices.md
获取限制处理与优化策略。

Configuration Reference

配置参考

Producer: Add queue binding to
wrangler.jsonc
queues.producers array with
binding
and
queue
fields.
Consumer: Configure in
wrangler.jsonc
queues.consumers array with
queue
,
max_batch_size
(1-100),
max_batch_timeout
(0-60s),
max_retries
,
dead_letter_queue
, and optionally
max_concurrency
(default: auto-scale).
CPU Limits: Increase
limits.cpu_ms
from default 30,000ms if processing takes longer.
Load
references/setup-guide.md
for complete configuration examples and
templates/wrangler-queues-config.jsonc
for production-ready config.

生产者: 在
wrangler.jsonc
的queues.producers数组中添加队列绑定,包含
binding
queue
字段。
消费者: 在
wrangler.jsonc
的queues.consumers数组中配置,包含
queue
max_batch_size
(1-100)、
max_batch_timeout
(0-60秒)、
max_retries
dead_letter_queue
,可选配置
max_concurrency
(默认:自动扩容)。
CPU限制: 如果处理时间较长,可将
limits.cpu_ms
从默认30000ms调高。
加载完整配置示例:
references/setup-guide.md
获取完整配置示例,
templates/wrangler-queues-config.jsonc
获取生产环境就绪配置。

Using Bundled Resources

使用捆绑资源

References (references/)

参考文档(references/)

  • setup-guide.md - Complete 6-step setup (queue → producer → consumer → DLQ → deploy → production config)
  • error-catalog.md - All 10 errors with solutions + prevention checklist
  • producer-api.md - Complete producer API (send, sendBatch, message format)
  • consumer-api.md - Complete consumer API (ack, retry, batch processing)
  • best-practices.md - Performance, monitoring, security, reliability patterns
  • wrangler-commands.md - CLI reference (create, delete, list, pause, resume)
  • typescript-types.md - Complete TypeScript type definitions for Queue, MessageBatch, Message
  • production-checklist.md - Pre-deployment verification and best practices
  • pull-consumers.md - Pull-based consumers for non-Workers environments (HTTP polling)
  • http-publishing.md - Publishing messages via HTTP API from external systems
  • r2-event-integration.md - R2 event notifications triggering queue messages
  • setup-guide.md - 完整6步部署流程(队列→生产者→消费者→DLQ→部署→生产配置)
  • error-catalog.md - 10类错误及解决方案+预防检查表
  • producer-api.md - 完整生产者API(send、sendBatch、消息格式)
  • consumer-api.md - 完整消费者API(ack、retry、批量处理)
  • best-practices.md - 性能、监控、安全、可靠性模式
  • wrangler-commands.md - CLI参考(创建、删除、列表、暂停、恢复)
  • typescript-types.md - Queue、MessageBatch、Message的完整TypeScript类型定义
  • production-checklist.md - 预部署验证与最佳实践
  • pull-consumers.md - 非Workers环境的拉取式消费者(HTTP轮询)
  • http-publishing.md - 通过HTTP API从外部系统发布消息
  • r2-event-integration.md - R2事件通知触发队列消息

Templates (templates/)

模板(templates/)

  • queues-producer.ts - Basic producer with single and batch sending
  • queues-consumer-basic.ts - Implicit ack consumer (idempotent operations)
  • queues-consumer-explicit-ack.ts - Explicit ack consumer (non-idempotent)
  • queues-retry-with-delay.ts - Exponential backoff retry pattern
  • queues-dlq-pattern.ts - Dead letter queue setup and consumer
  • wrangler-queues-config.jsonc - Complete production configuration

  • queues-producer.ts - 基础生产者,支持单条和批量发送
  • queues-consumer-basic.ts - 隐式确认消费者(适用于幂等操作)
  • queues-consumer-explicit-ack.ts - 显式确认消费者(适用于非幂等操作)
  • queues-retry-with-delay.ts - 指数退避重试模式
  • queues-dlq-pattern.ts - 死信队列部署与消费者
  • wrangler-queues-config.jsonc - 完整生产环境配置

TypeScript Types

TypeScript类型

Use
@cloudflare/workers-types
package for complete type definitions:
Queue
,
MessageBatch<Body>
,
Message<Body>
,
QueueSendOptions
.
Load
references/typescript-types.md
for complete type reference with interfaces, generics, type guards, and usage examples.

使用
@cloudflare/workers-types
包获取完整类型定义:
Queue
,
MessageBatch<Body>
,
Message<Body>
,
QueueSendOptions
加载完整类型参考:
references/typescript-types.md
获取包含接口、泛型、类型守卫及使用示例的完整类型文档。

Monitoring & Debugging

监控与调试

Key Commands:
wrangler queues info
(status),
wrangler tail
(logs),
wrangler queues pause-delivery/resume-delivery
(control).
Load
references/wrangler-commands.md
for complete CLI reference with real-time monitoring, debugging workflows, and performance analysis commands.

关键命令:
wrangler queues info
(状态)、
wrangler tail
(日志)、
wrangler queues pause-delivery/resume-delivery
(投递控制)。
加载完整CLI参考:
references/wrangler-commands.md
获取包含实时监控、调试流程、性能分析命令的完整文档。

Production Checklist

生产环境检查表

12-Point Pre-Deployment Checklist: DLQ configuration, message acknowledgment strategy, size validation, batch optimization, concurrency settings, CPU limits, error handling, monitoring, rate limiting, idempotency, load testing, and security review.
Load
references/production-checklist.md
for complete checklist with detailed explanations, code examples, and deployment workflow.

12点预部署检查表: DLQ配置、消息确认策略、大小验证、批量优化、并发设置、CPU限制、错误处理、监控、速率限制、幂等性、负载测试、安全评审。
加载完整检查表:
references/production-checklist.md
获取包含详细说明、代码示例、部署流程的完整检查表。

Related Skills

相关Skill

  • cloudflare-worker-base - Worker setup and configuration
  • cloudflare-d1 - Database integration for queue consumers
  • cloudflare-r2 - Store large message payloads
  • cloudflare-workflows - More complex orchestration needs

  • cloudflare-worker-base - Worker部署与配置
  • cloudflare-d1 - 队列消费者数据库集成
  • cloudflare-r2 - 存储大消息负载
  • cloudflare-workflows - 更复杂的编排需求

Official Documentation

官方文档


Questions? Issues?
  1. Check
    references/error-catalog.md
    for all 10 errors and solutions
  2. Review
    references/setup-guide.md
    for complete setup walkthrough
  3. See
    references/best-practices.md
    for production patterns
  4. Check official docs: https://developers.cloudflare.com/queues/

有疑问?遇到问题?
  1. 查看
    references/error-catalog.md
    获取所有10类错误及解决方案
  2. 查看
    references/setup-guide.md
    获取完整部署流程
  3. 查看
    references/best-practices.md
    获取生产环境模式
  4. 查看官方文档: https://developers.cloudflare.com/queues/