Kiryl Volkau


Hi! πŸ‘‹ I’m Kiryl Volkau, a software engineer based in Austin, Texas.

I specialize in Java and Spring Boot. I build scalable, reliable, and well-architected backend systems. I've worked on projects of all sizes β€” from startups to large enterprises like JPMorgan Chase.
My Photo

Advanced WebClient Patterns: Idempotency, Timeouts, and Testing

Advanced WebClient Patterns: Idempotency, Timeouts, and Testing

In the previous article, we covered the base builder pattern for WebClient. Now let’s make it production-ready.

You’ve set up a base WebClient.Builder with logging, retries, and error handling. Great start!

But production systems need more:

  • Idempotency keys to prevent duplicate payments
  • Custom timeouts for slow operations
  • Service-specific error handling for business logic
  • Tests to verify everything works

Let’s dive in.


Quick Recap: The Base Builder

In the previous article, we created a base builder:

WebClient Configuration: Stop Copy-Pasting Your HTTP Clients

WebClient Configuration: Stop Copy-Pasting Your HTTP Clients

You have 5 external APIs to call. Do you configure logging, retries, and timeouts 5 times? Or do you set it up once and reuse it everywhere?

Here’s a scenario I see all the time: you’re building a microservice that calls multiple external APIsβ€”a payment gateway, a file storage service, a notification API. Each needs its own WebClient, and each needs logging, error handling, retries, and timeouts.

Spring Boot Starters in Microservices: Sharing Code Without the Pain

Spring Boot Starters in Microservices: Sharing Code Without the Pain

When you have 10 microservices that all need to talk to the same file storage API, do you copy-paste the client code 10 times? Or do you build a starter once and share it everywhere?

In my previous article, we explored how Spring Boot starters work under the hood. Now let’s talk about something more practical: how to use starters to avoid code duplication in microservice architectures.

Spring Boot Starters

Spring Boot Starters

Ever wondered why adding spring-boot-starter-web or spring-boot-starter-data-jpa just makes things work? Let’s break down what Starters actually do and why they’re so powerful.

When I first started working with Spring, I was always wondering:
What is spring-cloud-starter-openfeign?
What is spring-boot-starter-web?

At first glance, they just seemed like convenient libraries with some pre-made configuration. But actually, they are what makes Spring Boot fast, easy to use, and help keep your pom.xml clean.