Oh wait, like that. Why not just put the consumer logic in the Worker?
Oh wait, like that. Why not just put the consumer logic in the Worker?

queue method into my pages app and I can't put the producing code that execute sendBatch into the worker either. Is there no solution for this?Error: Queue send failed: Service Temporarily Unavailable ??

async queue(batch: MessageBatch<TransactionModel>, env: Bindings): Promise<void> {
try {
let messages = JSON.stringify(batch.messages);
console.log(`consumed from our queue: ${JSON.stringify(messages)}`);
} catch (error) {
console.log('Error=>',error);
}
},type Bindings = {
AIS_ALL_TRANSACTIONS:KVNamespace
}
export default {
fetch: app.fetch,
async queue(batch: MessageBatch<TransactionModel>, env: Bindings): Promise<void> {
}}[[kv_namespaces]]
binding = "AIS_ALL_TRANSACTIONS"
id = "xxxxx" <=I have the correct Id in here
[[queues.consumers]]
queue = "my-q" <=Correct queue here as well
# Optional: Configure batching and retries: https://developers.cloudflare.com/queues/learning/batching-retries/
# max_batch_size = 10 //The maximum number of messages to deliver before the timeout
# max_batch_timeout = 30 //default is 5 seconds
# max_retries = 10 //default to 3
# all dead transactions go to the following dead letter queue
dead_letter_queue = "transaction-dead-q"