Tag

CompletableFuture

1 views collected around this technical thread.

Cognitive Technology Team
Cognitive Technology Team
Apr 29, 2025 · Backend Development

Common CompletableFuture Pitfalls and Best Practices in Java

This article examines the powerful Java CompletableFuture class, identifies frequent misuse pitfalls such as ignored exceptions, wrong thread‑pool choices, blocking callbacks, context loss, and overly fragmented chains, and provides concrete avoidance strategies and best‑practice recommendations for robust asynchronous programming.

Best PracticesCompletableFutureConcurrency
0 likes · 9 min read
Common CompletableFuture Pitfalls and Best Practices in Java
FunTester
FunTester
Apr 18, 2025 · Backend Development

Using CompletableFuture for Parallel REST Calls in Java

The article explains why serial REST calls cause performance bottlenecks, illustrates the benefits of concurrent requests, and demonstrates how Java 8's CompletableFuture can be used to implement parallel REST calls with robust exception handling, improving throughput and resource utilization.

CompletableFutureConcurrencyJava
0 likes · 10 min read
Using CompletableFuture for Parallel REST Calls in Java
Cognitive Technology Team
Cognitive Technology Team
Apr 12, 2025 · Backend Development

Using CompletableFuture with Streams for Parallel Execution in Java

The article explains how to correctly combine Java's CompletableFuture with Stream API to achieve true asynchronous parallelism, highlights common pitfalls that lead to sequential execution, and provides the proper pattern of creating a CompletableFuture stream followed by a terminal operation.

CompletableFutureConcurrencyJava
0 likes · 3 min read
Using CompletableFuture with Streams for Parallel Execution in Java
FunTester
FunTester
Apr 9, 2025 · Backend Development

Understanding Future and CompletableFuture in Java for Asynchronous Programming

This article explains the concepts, differences, and practical usage of Java's Future and CompletableFuture for asynchronous programming, highlighting their blocking behavior, task composition, exception handling, and suitable scenarios in performance testing and complex test workflows, with detailed code examples.

Asynchronous ProgrammingCompletableFutureConcurrency
0 likes · 14 min read
Understanding Future and CompletableFuture in Java for Asynchronous Programming
macrozheng
macrozheng
Mar 31, 2025 · Backend Development

9 Ways to Implement Asynchronous Programming in Java – From Threads to CompletableFuture

This tutorial enumerates nine Java asynchronous programming techniques—including Thread/Runnable, Executors, custom thread pools, Future/Callable, CompletableFuture, ForkJoinPool, Spring @Async, message queues, and Hutool ThreadUtil—explains their advantages and drawbacks, and provides complete code examples for each method.

CompletableFutureJavaMQ
0 likes · 14 min read
9 Ways to Implement Asynchronous Programming in Java – From Threads to CompletableFuture
IT Services Circle
IT Services Circle
Mar 22, 2025 · Backend Development

Nine Ways to Implement Asynchronous Programming in Java

This article introduces nine different approaches to achieve asynchronous programming in Java, including using Thread and Runnable, Executors thread pools, custom thread pools, Future and Callable, CompletableFuture, ForkJoinPool, Spring @Async, message queues, and Hutool's ThreadUtil, with code examples and usage tips.

CompletableFutureExecutorJava
0 likes · 15 min read
Nine Ways to Implement Asynchronous Programming in Java
Java Tech Enthusiast
Java Tech Enthusiast
Mar 22, 2025 · Backend Development

9 Ways to Implement Asynchronous Programming in Java

The article outlines nine practical approaches for asynchronous programming in Java—including low‑level Thread/Runnable, managed Executors and custom thread pools, Future/Callable, CompletableFuture, ForkJoinPool, Spring’s @Async annotation, message‑queue integration, and the Hutool ThreadUtil utility—offering a comprehensive toolbox for scalable, non‑blocking execution.

CompletableFutureExecutorJava
0 likes · 13 min read
9 Ways to Implement Asynchronous Programming in Java
Java Captain
Java Captain
Mar 21, 2025 · Backend Development

Request Merging and Batch Processing in Java Spring Boot to Reduce Database Connections

This article explains how to merge multiple user‑detail requests into a single database query using a blocking queue, scheduled thread pool, and CompletableFuture in Spring Boot, providing code examples, a high‑concurrency test, and discussion of trade‑offs such as added latency and timeout handling.

CompletableFutureConcurrencyJava
0 likes · 13 min read
Request Merging and Batch Processing in Java Spring Boot to Reduce Database Connections
IT Services Circle
IT Services Circle
Mar 13, 2025 · Backend Development

Common Pitfalls When Using CompletableFuture in Java

This article introduces the advantages of Java's CompletableFuture and systematically outlines six common pitfalls—including default thread‑pool issues, exception handling, timeout management, thread‑local context loss, callback hell, and task‑ordering problems—while providing correct code examples and best‑practice recommendations.

AsyncCompletableFutureConcurrency
0 likes · 10 min read
Common Pitfalls When Using CompletableFuture in Java
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Feb 10, 2025 · Backend Development

Master Java Asynchronous Programming: 7 Powerful Techniques with Code Samples

This article explains why asynchronous programming boosts Java application performance and walks through seven practical methods—Thread, FutureTask, CompletableFuture, Guava ListenableFuture, EA‑Async, Cactoos, and Jcabi‑Aspects—each illustrated with complete, runnable code examples.

Asynchronous ProgrammingCompletableFutureConcurrency
0 likes · 14 min read
Master Java Asynchronous Programming: 7 Powerful Techniques with Code Samples
macrozheng
macrozheng
Feb 6, 2025 · Backend Development

Mastering Java Async: Future, Callable, CompletableFuture, and FutureTask Explained

This article explores four Java asynchronous programming approaches—Future with Callable, CompletableFuture, and FutureTask—detailing their principles, usage patterns, code examples, and how to retrieve results from thread pools, helping developers improve performance for tasks like aggregating order and fee summaries.

CallableCompletableFutureConcurrency
0 likes · 12 min read
Mastering Java Async: Future, Callable, CompletableFuture, and FutureTask Explained
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 25, 2025 · Backend Development

Mastering CompletableFuture in Java: Basics, Advanced Features, and Best Practices

This comprehensive guide introduces Java's CompletableFuture, explains its advantages over the traditional Future API, demonstrates how to create and compose asynchronous tasks, manage thread pools, handle timeouts and cancellations, and apply robust exception handling techniques for reliable concurrent programming.

Asynchronous ProgrammingCompletableFutureConcurrency
0 likes · 16 min read
Mastering CompletableFuture in Java: Basics, Advanced Features, and Best Practices
Architecture Digest
Architecture Digest
Jan 23, 2025 · Backend Development

Using Future, Callable, CompletableFuture, and FutureTask for Asynchronous Tasks in Java

This article explains how to improve backend performance by fetching independent report data concurrently using Java's Future, Callable, CompletableFuture, and FutureTask classes, provides code examples for each approach, and compares their principles, usage patterns, and cancellation capabilities.

CallableCompletableFutureConcurrency
0 likes · 9 min read
Using Future, Callable, CompletableFuture, and FutureTask for Asynchronous Tasks in Java
IT Services Circle
IT Services Circle
Jan 7, 2025 · Backend Development

Replacing Thread.sleep Loops with Proper Scheduling in Java

The article explains why using Thread.sleep in a loop causes busy‑waiting and performance problems, and demonstrates several Java scheduling alternatives—including Timer/TimerTask, ScheduledExecutorService, wait/notify, and CompletableFuture—to efficiently check a flag at fixed intervals.

CompletableFutureConcurrencyJava
0 likes · 9 min read
Replacing Thread.sleep Loops with Proper Scheduling in Java
JD Tech Talk
JD Tech Talk
Dec 23, 2024 · Backend Development

Asynchronous Timeout Implementation for CompletableFuture in JDK 8

This article proposes an asynchronous timeout implementation for CompletableFuture in JDK 8, addressing the lack of built-in timeout interruption capabilities and providing a solution for precise task timeout control.

Asynchronous ProgrammingCompletableFutureConcurrency
0 likes · 10 min read
Asynchronous Timeout Implementation for CompletableFuture in JDK 8
Java Tech Enthusiast
Java Tech Enthusiast
Dec 12, 2024 · Backend Development

Java CompletableFuture: Asynchronous Programming Guide

Java's CompletableFuture, introduced in Java 8, replaces the blocking Future with a rich, non‑blocking API that supports asynchronous task creation, result retrieval via get/join, chaining callbacks, exception handling, task combination (AND/OR, allOf/anyOf), and recommends custom executors, timeouts, and proper saturation policies.

Asynchronous ProgrammingBest PracticesCompletableFuture
0 likes · 16 min read
Java CompletableFuture: Asynchronous Programming Guide
Top Architecture Tech Stack
Top Architecture Tech Stack
Nov 26, 2024 · Backend Development

Understanding CountDownLatch and CompletableFuture in Java Concurrency

This article explains the purpose, typical usage scenarios, and provides concrete code demonstrations of Java's CountDownLatch and CompletableFuture, comparing their synchronization versus asynchronous capabilities and guiding developers on selecting the appropriate tool for effective multithreaded programming.

CompletableFutureConcurrencyCountDownLatch
0 likes · 6 min read
Understanding CountDownLatch and CompletableFuture in Java Concurrency
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Oct 28, 2024 · Backend Development

Master Asynchronous Programming in Spring Boot 3 with @Async and CompletableFuture

This article demonstrates how to enable and use Spring Boot 3's @Async annotation together with Java's CompletableFuture to create custom thread pools, run multiple asynchronous REST calls concurrently, aggregate their results, and handle exceptions, providing a complete backend solution for high‑performance APIs.

AsyncCompletableFutureJava
0 likes · 8 min read
Master Asynchronous Programming in Spring Boot 3 with @Async and CompletableFuture
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 10, 2024 · Backend Development

Boost SpringBoot Performance: Parallel REST Calls with CompletableFuture

This tutorial demonstrates how to use Java's CompletableFuture in SpringBoot 2.7.18 to parallelize multiple external REST API calls, covering code implementation, exception handling, and timeout management to improve response time and scalability.

CompletableFutureError HandlingJava Concurrency
0 likes · 9 min read
Boost SpringBoot Performance: Parallel REST Calls with CompletableFuture
Architect's Guide
Architect's Guide
Aug 25, 2024 · Backend Development

Eight Ways to Implement Asynchronous Execution in Java

This article introduces eight common Java asynchronous implementation techniques—including raw threads, Future, CompletableFuture, Spring @Async, ApplicationEvent, message queues, third‑party utilities like Hutool ThreadUtil and Guava ListenableFuture—explaining their usage, code examples, advantages, and drawbacks for improving performance in scenarios such as sending SMS or emails.

CompletableFutureFutureGuava
0 likes · 14 min read
Eight Ways to Implement Asynchronous Execution in Java