How to Configure a Thread Pool With ExecutorService in Java
Build a bounded thread pool for a support-ticket desk in Java 21: pick the size, cap the queue, name threads, count rejections, and shut down cleanly.
Build a bounded thread pool for a support-ticket desk in Java 21: pick the size, cap the queue, name threads, count rejections, and shut down cleanly.
Build an order desk in Java 21 with the chain of responsibility pattern: validators reject, approvers escalate, and a trail shows who decided. Gradle, tested.
Build an immutable room booking in Java 21 with a nested builder, validation in build(), toBuilder() copies and a step builder, all compiled and run.
Build a parcel scan log in Java 21 with NIO.2: append, stream, atomically replace and archive files, plus 20 checks and the errors I hit on purpose.
Build an on-call rota in Java 21 with EnumSet for roles and gaps and EnumMap for schedules and counts, then trigger ten traps that bite in real code.
Build a stock-sync job in plain Java 21 and use CountDownLatch, CyclicBarrier and Semaphore each where it fits, with runnable checks and the traps I forced.
Build a URL shortener in Java 21 with a static factory, a registry factory and an abstract factory, then swap memory for file storage with one config value.
Build a stock-alert system with the observer pattern in Java 21: a thread-safe subject, lambda listeners, safe unsubscribe, and 16 checks that prove it works.
Build a parcel-scan counter on JDK 21 with AtomicLong, LongAdder, AtomicReference and AtomicBoolean, then fix a dock gate that lets three trucks into two bays.
Build a currency-rate pipeline with a bounded BlockingQueue: back-pressure, poison pills, clean shutdown and 15 plain-Java checks on JDK 21. Full code.