Wrangler app that uses a Durable Object to publish messages to a queue.
- Cloudflare:
- Must have set the
CLOUDFLARE_API_TOKEN
variable in your local environment.
- Must have set the
- pnpm:
- Must be installed in your system.
- Wrangler:
- Must be installed in your system.
Create queue:
npx wrangler queues create my-queue
Create worker:
npx wrangler deploy
-
Grab the
<worker_route_trigger_url>
from the deployment:Published my-worker <worker_route_trigger_url> Producer for my-queue
-
Navigate to
https://my-worker.<subdomain>.workers.dev?userId=test
. -
Check that a message is present in
my-queue
from the Cloudflare dashboard.
npx wrangler delete