can somebody help me? i get empty payload in the queue message
can somebody help me? i get empty payload in the queue message


this.state.id to just "hello", does it work? What are you actually trying to do?
this.state.id, which doesn't directly serialize to JSON. I've PR'ed the docs to fix this: https://github.com/cloudflare/cloudflare-docs/pull/14665 - it needs to be this.state.id.toString()queue() handler accepts a message, the Env, and the context per https://developers.cloudflare.com/queues/configuration/javascript-apis/#consumer
context.get('variable') within the queue? My CTX is empty within the Queue consumercontext.get might be a hono thing, i forgot, either way. I'm not sure how to access my variables that i set from my middlewaresfetch handler?Web -> route endpoint -> queue producer -> queue consumer -> process messagesworkers.api.error.queue_handler_missing error when deploying. the producer worker doesn't handle the queue and in wrnagler.toml i have only producer part of the configuration.max_batch_size is set to 1 so that it doesn't assign a batch of, say, 5 messages to a single worker..wrangler directories and seem to be isolated, so they don't share a queue. To make them able to talk to the same queue do I need to use --persist-to on both?delaySecondsrust based queue i can use as reference?Web -> route endpoint -> queue producer -> queue consumer -> process messagesworkers.api.error.queue_handler_missing.wranglerdelaySecondsrustexport const producerTest = async (c) => {
try {
await c.env.TestQueue.send(JSON.stringify({
slug: 'test123',
timestamp: new Date().toISOString()
}), { delaySeconds: 300 });
return c.json('Queued', httpStatus.OK);
} catch (error) {
console.log(`Error in test ${error.message}`);
const response = createResponse(
{},
{
message: `Error occured in test ${error.message}`,
}
);
return c.json(response, httpStatus.INTERNAL_SERVER_ERROR);
}
};export const app = new Hono<HonoContext>();
export default {
async fetch(request: Request, env: TEnv, ctx: ExecutionContext) {
const validatedEnv = envSchema.safeParse(env);
if (!validatedEnv.success) {
console.log(validatedEnv.error);
return Response.json({ message: "Invalid ENV variables." });
}
return app.fetch(request, validatedEnv.data, ctx);
},
async queue() {...}
};