can i create a producer or consumer in a pages project like sveltekit?
can i create a producer or consumer in a pages project like sveltekit?
fetch() handler. It’s null because I suspect you’re trying to pass the socket (somehow?) across handlers: you can’t.Internal Server Error. Known Issues
Wrangler does not yet support running separate producer and consumer Workers bound to the same Queue locally. To develop locally with Queues, you can temporarily put your consumer’s queue() handler in the same Worker as your producer, so the same Worker acts as both a producer and consumer.
Wrangler also does not yet support wrangler dev --remote.



fetch, it just skip / stops running. Yesterday I assumed that the fetches were disabled on the queue, but minutes ago I saw an example on the CF Docs where a fetch is made inside a queue.https://developers.cloudflare.com/queues/examples/web-crawler-with-browser-rendering/#6-crawl-with-puppeteer
await ing the fetch? Do you have a try-catch handler and are you seeing any errors logged?awaiting the fetch and I also put inside a try/catch, but no error is logged. API URL log, and then the code skips everything below the logsend and sendBatch methods returning a single (or array of for batch) string(s) representing each message sent to the queuePromise<void>, is there any chance that this might come along, or even be an option to enable it in the command itself (eg MY_QUEUE.send('my payload', {resolveId: true})


[[queues.producers]]
queue = "pdx-dev-stripe-queue"
binding = "STRIPE_QUEUE"
[[queues.consumers]]
queue = "pdx-dev-stripe-queue"
max_batch_size = 1
max_batch_timeout = 30try {
console.log('API URL :', `${env.STRAPI_API_URL}/c-orders`);
const connection = await fetch(`${env.STRAPI_API_URL}/c-orders`, {
headers: {
Authorization: `Bearer ${env.STRAPI_API_KEY}`,
'Content-Type': 'application/json',
},
method: 'POST',
body: JSON.stringify({
data: {
planId,
date: new Date(),
deliveryDate: new Date(deliveryDate * 1000),
status: 1,
details,
grossPrice: totalPrice,
finalPrice: totalPrice,
subscriptionId: subscription ? strapiSubscriptionId : null,
userId,
paymentId: paymentIntent,
paymentStatus: subscription ? 'processing' : 'success',
orderInfo: [],
stripeInvoiceId: invoice,
},
}),
});
console.log('connection :', connection);
const data = await connection.json();
console.log('data :', JSON.stringify(data, null, 2));
if (connection.status !== 200) wasOrderCreated = false;
wasOrderCreated = true;
} catch (err) {
console.log('err :', err);
return false;
} {
"message": [
"Queue is dead=>",
null
],
"level": "log",
"timestamp": 1695380365584
},async queue(batch: MessageBatch<any>, env: Env): Promise<void> {
try {
let messages = JSON.stringify(batch.messages);
console.log(`consumed from our queue: ${messages}`);
if(serverSocket !== undefined){
console.log('ServerSocket=>', serverSocket) ;
serverSocket.send(messages);
}else{
console.log('ServerSocket Undefined=>', serverSocket) ;
console.log('Sending from Running Sock=>', serverSocket) ;
env.runningSock.send(messages);
}
} catch (error) {
console.log('Error=>',error);
}
},