Build Priority Background Jobs & Dead Letter Queues with NATS JetStream | Rethink Connectivity ep 12
ฝัง
- เผยแพร่เมื่อ 27 ส.ค. 2024
- Job/Worker queues are an extremely common distributed computing pattern. In this episode, Jeremy goes over the architecture of a work queue with priority and dead letter queue semantics, then uses the flexibility of NATS JetStream to express this pattern from scratch.
Source code and text tutorial available here:
github.com/Con...
Sign up for RethinkConn 2024 for Free!:
www.crowdcast....
Don't want to host NATS yourself? Sign up for Synadia Cloud for free: cloud.synadia....
NATS is a connective technology powering modern distributed systems, unifying Cloud, On-Premise, Edge, and IoT.
Join the NATS Community on Slack: slack.nats.io
Learn More about NATS at docs.nats.io/
❤ Sharing practical examples is amazing, thanks Jeremy!!! 😊
Glad you like them!
Great video!
One thing I do using nakWithDelay is using it for supporting scheduling messages into the future. Many times you don't want to send an email now, you want to send it 1 or 2 hours into the future. So I set a header with schedule time, and on consumer end I check this header and nak with delay so that jetstsream redelivers this message at that time. This means your number of max attempts should be whatever you want + 1 since the first nak is not actually a failure.
That's a great idea! Thanks for sharing!
Grateful for the effort you put into creating such informative videos. Really appreciate the time and effort you invest in making these videos. Thank you! 👍
Hi thank you very much for new material :-). It's great!. I glad you publish regular, so learning is smooth :-)
Great video!! Thanks for all your efforts!
I just deployed a nice NATS server pubs and subs and I'm about to stress test it. I hope it goes well cause it was a breeze to integrate. Well done! ❤
When the message has reached the redeliveries limit, is there any way to "reset" this counter for this message, so it can be redelivered again? That might be useful when you had a bug in your consumer that was preventing the delivery, but then you've fixed it and now it should be capable of processing these pending messages normally.
Thanks for the great video!
Thanks for you effort. Amazing Video
Thanks for the sub!
Does NATS offer a way to order queues? E.g. start processing messages from queue B only after queue A is empty.
Hey, I'm curious if "bench" is working for microservices as well, or is it primarily designed for streams? If it does work for microservices too, I'd really appreciate it if you could create a video exploring this topic. Thanks!
Yup. Nats bench works for microservices as well, see the request/reply latency benchmarking section: docs.nats.io/using-nats/nats-tools/nats_cli/natsbench#run-a-request-reply-latency-test
BTW, Which app you use to draw diagram?
Excalidraw
excalidraw