```js export const app = new Hono<HonoContext>(); export default { async fetch(request: Request,

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() {...}
};


I just thought i'd be able to access some in-memory context set by my fetch middlewares, but the queue consumer is isolated from that, so I just created a DB client manually to do operations within the consumer.

My flow is
Web -> route endpoint -> queue producer -> queue consumer -> process messages
Was this page helpful?