Skip to content

Wrangler app that uses a Durable Object to publish messages to a queue

Notifications You must be signed in to change notification settings

garysassano/wrangler-cloudflare-durable-objects-queue

Repository files navigation

wrangler-cloudflare-durable-objects-queue

Wrangler app that uses a Durable Object to publish messages to a queue.

Prerequisites

  • Cloudflare:
    • Must have set the CLOUDFLARE_API_TOKEN variable in your local environment.
  • pnpm:
  • Wrangler:

Deployment

Create queue:

npx wrangler queues create my-queue

Create worker:

npx wrangler deploy

Usage

  1. Grab the <worker_route_trigger_url> from the deployment:

    Published my-worker
      <worker_route_trigger_url>
      Producer for my-queue
  2. Navigate to https://my-worker.<subdomain>.workers.dev?userId=test.

  3. Check that a message is present in my-queue from the Cloudflare dashboard.

Cleanup

npx wrangler delete

Architecture Diagram

Architecture Diagram

Releases

No releases published

Packages

No packages published