


delaySeconds option in sendBatch apply to each message in the batch? Or once for the entire batch.delaySeconds option? If I try using it in local dev, I get these:npx wrangler@latest dev —test-scheduled and the same thing happened—test-scheduled is not related to Queues: https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/
app.get("/test", async c => {
const message = `Test message. Random number: ${Math.floor(Math.random() * 100)}`;
await c.env.WEBSITE_QUEUE.send({
body: message,
});
return c.json({ success: `Queued up this message: ${message}` });
});export default {
fetch: app.fetch,
async queue(batch: MessageBatch<{ body: string }>, env: Environment) {
for (const message of batch.messages) {
console.log(
`Consuming message: ${JSON.stringify(message.body, null, 2)}`
);
}
},
};