Rust + Axum Async Microservice Guide: Job Queue, Retries, and Graceful Shutdown

If async tasks keep waking you up at 3 a.m., this guide is for you. We’ll build a resilient microservice with Rust + Axum that processes jobs reliably, scales well, and shuts down gracefully. The mental model: a busy coffee shop An HTTP request is like a customer placing an order. You shouldn’t block the cashier until the coffee is brewed. Instead: accept the order, hand it to the kitchen, and move on to the next customer. Our job queue is the order slip; workers are the baristas. ...

August 17, 2025 · 4 min · 797 words · Rexai Programming
Complete implementation and best practices for Rust Axum graceful shutdown

Rust Axum Graceful Shutdown, The Ultimate Guide: Fix the pitfall 99% of engineers hit

Rust Axum Graceful Shutdown, The Ultimate Guide: Fix the pitfall 99% of engineers hit Follow Moshou Coding on WeChat to learn Rust the easy way. Do these production nightmares look familiar? You reboot the server and lose user data. DB connections fail and transactions get rolled back. WebSocket links drop and the UX craters. The root cause is a detail 99% of developers overlook — Rust Axum graceful shutdown. Let’s make it practical and friendly while staying production‑grade. ...

August 17, 2025 · 3 min · 449 words · Rexai Programming
Build a high‑performance Web server with Rust and Axum

Rust + Axum, from zero to hero: build a high‑performance Web server the LEGO way

You’ve heard the rumors: Rust is blazing fast and memory‑safe, but writing backend services feels intimidating. What if it could feel like building with LEGO — intuitive, composable, and fun? Enter Axum, a modern Web framework built by the Tokio team. In this tutorial you’ll: Understand Axum’s core concepts: Router, handlers, extractors Work with path parameters, query parameters, and JSON Add shared state with Arc<Mutex<T>> Install middleware such as structured tracing Step 1: Add dependencies axum = "0.7" tokio = { version = "1", features = ["full"] } Or via CLI: ...

August 14, 2025 · 2 min · 404 words · Rexai Programming
The difference between Tokio tasks and OS threads

Stop treating tokio::spawn as a thread! I launched 1000 tasks in 2 seconds and the system stayed calm

Follow Rexai Programming on WeChat to learn Rust the easy way. Forget the heavy “thread” mental model from your OS class. Today, I’ll show you a delightful trick about Tokio. You think tokio::spawn creates a thread? Nope. It gives you something smarter, lighter, and frankly a little sneaky: the ability to harness massive concurrency at a shockingly low cost. This is one of Rust’s secret weapons in backend development. Ready? Let’s reveal the trick. ...

August 11, 2025 · 4 min · 818 words · Rexai Programming