
How to Implement Retries Timeouts and Bulkheads in Java
Build resilient calls in plain Java: bounded timeouts, retries with backoff and jitter, a semaphore bulkhead and how the three combine safely.
Tag
223 posts

Build resilient calls in plain Java: bounded timeouts, retries with backoff and jitter, a semaphore bulkhead and how the three combine safely.

Validate input in Quarkus with Hibernate Validator: constraints on request records, Valid on resources, method parameters and a custom error response.

Create and clean up temporary files in JUnit with TempDir, share a directory per class, load files from test resources and avoid fragile paths in tests.

Find why a Java application starts slowly: measure each phase, log class loading and bean creation, catch DNS and network stalls, then fix the biggest item.

Validate Struts 2 form input with a validate method, XML validation files or annotations, show field errors and see how input routes failures.

Write Twirl templates for a Play application, with typed parameters, loops, conditions, layouts and reusable partials, and see how they compile to Java.

Build a Micronaut application into a GraalVM native executable with Maven or Gradle, see what to expect and how to fix the reflection issues that remain.

Test Vaadin Flow views at two levels: fast unit tests that drive components without a browser, and end to end browser tests with TestBench or Playwright.

Build and test a Maven Java project on every push with GitHub Actions, using setup-java, a JDK matrix, test reports and a job that fails on broken tests.

Use Testcontainers at development time in Spring Boot: ServiceConnection, a test entry point, reusing containers and sharing definitions with tests.

Prevent insecure deserialization in Java: avoid ObjectInputStream on untrusted data, use serial filters, safe formats like JSON and gadget chain awareness.

Reduce Java allocation rates in hot code: measure with JFR and JMH, avoid boxing and temporary strings, reuse buffers, use primitives and know when to stop.