@Matt ! Thanks for 1 and 3. For 2: we finally got a reply from our Cloudflare TAM and yes, they st

@Matt ! Thanks for 1 and 3. For 2: we finally got a reply from our Cloudflare TAM and yes, they stated we need to add a payment method on our non-prod account. I'm working on us setting that up.
16 Replies
MetalGear
MetalGear15mo ago
Hey guys, really loving my solution using only cloudflare services for my backend api but im currently suffering from one problem I am hoping someone can guide me. I am using cloudflare queues to manage events that need to be processed say sending a command to a iot device. That iot device 3rd party api has been giving me issues sometimes where its unnavailable for 3 hours due to maintnanace on their end. So when my worker consumes that queue I need a way to keep retrying all the queue items every hour. until they succeed and then I can mark them as consumed. Do you guys think i should just use upstash for now if I need those features?
switz
switz15mo ago
whats the best way to retry a message in the queue but on a delay? will retries happen immediately?
MetalGear
MetalGear15mo ago
No good way to do that right now unfortunetely based on my limited experience. I needed a solution fast so i just temporarily moved to qstash from upstash
switz
switz15mo ago
alternatively, would be nice to consume a queue from an external application. that would solve the problem for me so I only consume items when my server is up and running
switz
switz15mo ago
elithrar
elithrar15mo ago
This is coming (HTTP Pull) in the future.
switz
switz15mo ago
Sweet, I’d really love that.
Sameer Ali
Sameer Ali15mo ago
I am looking at queue api docs, there is no way to send something to queue outside of the worker. Am i missing anything?
elithrar
elithrar15mo ago
Get started · Cloudflare Queues
Cloudflare Queues is a flexible messaging queue that allows you to queue messages for asynchronous processing. By following this guide, you will …
Sameer Ali
Sameer Ali15mo ago
Thanks ❤️
Bao N.
Bao N.15mo ago
my producer is simple:
export interface Env {
MY_QUEUE: Queue;
}

export default {
async fetch(req: Request, env: Env, ctx: ExecutionContext): Promise<Response> {

// if req.method is not POST , reject
if (req.method !== 'POST') {
return new Response('Sorry', { status: 405 });
}
const body = await req.json();
console.log(`got body: ${JSON.stringify(body)}`)
const result = await env.MY_QUEUE.send({
body: body,
contentType: "json",
});
console.log(`sent message to queue: ${JSON.stringify(result)}`);
return new Response(JSON.stringify({
return_code: "1",
return_message: "ok"
}), {
headers: { 'Content-Type': 'application/json' },
});
},
};
export interface Env {
MY_QUEUE: Queue;
}

export default {
async fetch(req: Request, env: Env, ctx: ExecutionContext): Promise<Response> {

// if req.method is not POST , reject
if (req.method !== 'POST') {
return new Response('Sorry', { status: 405 });
}
const body = await req.json();
console.log(`got body: ${JSON.stringify(body)}`)
const result = await env.MY_QUEUE.send({
body: body,
contentType: "json",
});
console.log(`sent message to queue: ${JSON.stringify(result)}`);
return new Response(JSON.stringify({
return_code: "1",
return_message: "ok"
}), {
headers: { 'Content-Type': 'application/json' },
});
},
};
after make 1 request via PostMan there's a lots triggering this function, make massive queues produced to the Queue any of them, has same logs like below:
"logs": [
{
"message": [
"got body: {\"data\":\"dat hart fd3 3\"}"
],
"level": "log",
"timestamp": 1696396087813
},
{
"message": [
"sent message to queue: undefined"
],
"level": "log",
"timestamp": 1696396087867
}
]
"logs": [
{
"message": [
"got body: {\"data\":\"dat hart fd3 3\"}"
],
"level": "log",
"timestamp": 1696396087813
},
{
"message": [
"sent message to queue: undefined"
],
"level": "log",
"timestamp": 1696396087867
}
]
what's wrong with my code? or is this a bug? any helps?
No description
Bao N.
Bao N.15mo ago
found out it's because the routes endwith wildcard (star), without slashes rightbefore ( domain.com/a* => bug massive trigger) ( domain.com/a/* => works now)
marina.lipeck
marina.lipeck15mo ago
hey guys! is there a way to increase the limit of queues? We used the request form (https://docs.google.com/forms/d/e/1FAIpQLSd_fwAVOboH9SlutMonzbhCxuuuOmiU1L_I5O2CFbXf_XXMRg/viewform) from the docs a couple of weeks ago, but never got any answer
Google Docs
Cloudflare Developer Platform: Limit Increase Request Form
Want to increase the limits of your current plan? Let us know what your requirements are here.
elithrar
elithrar15mo ago
Which limit are you looking to increase?
marina.lipeck
marina.lipeck15mo ago
Limits · Cloudflare Queues
Many of these limits will increase during Queues’ public beta period. Follow our changelog or join the #queues-beta channel in our Developer Discord …
elithrar
elithrar15mo ago
I can't see which request is yours: can you share your account ID here? I'll increase it to 10,000.
Want results from more Discord servers?
Add your server