Tagged articles
RejectionPolicy
22 articles · Page 1 of 1
A Java thread pool that looks larger can actually cause out‑of‑memory errors when core parameters such as core size, max size, queue type, keep‑alive time, thread factory, and rejection policy are mis‑configured, leading to uncontrolled task accumulation and resource exhaustion in production.
ConcurrencyJavaOOM
0 likes · 22 min read

The article explains that ThreadPoolExecutor’s execution flow first fills core threads, then enqueues tasks, and only creates non‑core threads after the work queue is full, so a high maximumPoolSize (e.g., 100) does not guarantee rapid thread growth, and queue choice and rejection policies critically shape scaling behavior.
ConcurrencyJavaQueue
0 likes · 9 min read

This article provides a thorough, source‑level walkthrough of Java's ThreadPoolExecutor, covering its core design, state machine, seven key parameters, task‑submission flow, worker creation, execution loop, rejection policies, common pool variants, and interview‑ready explanations of the execute() process.
BlockingQueueConcurrencyExecutorService
0 likes · 10 min read

This article explains why thread pools fail under high load, details the four built‑in Java rejection policies, presents real‑world case studies, and offers practical guidelines—including code snippets and dynamic scaling techniques—to keep services stable during traffic spikes.
ConcurrencyRejectionPolicyThreadPool
0 likes · 7 min read

This article explains when ThreadPoolExecutor rejection handlers are triggered, compares the four built‑in policies, and provides detailed implementations for custom persistence, message‑queue integration, parameter tuning, graceful shutdown, and real‑world scenarios to ensure no tasks are lost.
ConcurrencyJavaKafka
0 likes · 8 min read

This article explains the four standard Java ThreadPoolExecutor rejection policies—AbortPolicy, CallerRunsPolicy, DiscardOldestPolicy, and DiscardPolicy—detailing their behavior, suitable scenarios, and providing full code examples, plus guidance on creating custom policies.
ConcurrencyJavaRejectionPolicy
0 likes · 3 min read

This article explains Java's ThreadFactory interface, demonstrates how to customize thread names, explores the four built‑in rejection policies of ThreadPoolExecutor with code examples, and shows techniques for dynamic adjustment of core and maximum pool sizes, including custom policies and blocking queue task submission.
DynamicThreadPoolJavaRejectionPolicy
0 likes · 19 min read

Java's ThreadPoolExecutor provides four built‑in RejectedExecutionHandler strategies—AbortPolicy, CallerRunsPolicy, DiscardPolicy, and DiscardOldestPolicy—each suited to different overload scenarios, and this article explains their behavior, trigger conditions, and practical application guidelines for robust backend concurrency management.
ConcurrencyJavaRejectionPolicy
0 likes · 10 min read

This article explains the conditions that trigger Java thread‑pool rejection policies, describes the four built‑in policies (AbortPolicy, CallerRunsPolicy, DiscardPolicy, DiscardOldestPolicy), provides detailed code examples for each, and discusses suitable application scenarios for backend developers.
ConcurrencyJavaRejectionPolicy
0 likes · 13 min read

This article breaks down the four Java ThreadPool rejection policies—AbortPolicy, CallerRunsPolicy, DiscardOldestPolicy, and DiscardPolicy—detailing their implementation, ideal use cases, advantages, and drawbacks to help developers choose the right strategy for handling overloaded executors.
ConcurrencyJavaRejectionPolicy
0 likes · 5 min read

This article explains the various ThreadPoolExecutor rejection policies, highlights the risks of using CallerRunsPolicy, provides code examples, and suggests mitigation strategies such as adjusting queue size, thread count, or persisting overflow tasks to databases or message queues.
CallerRunsPolicyConcurrencyJava
0 likes · 9 min read

This guide explains the five ThreadPoolExecutor rejection policies in Java—AbortPolicy, CallerRunsPolicy, DiscardPolicy, DiscardOldestPolicy, and custom handlers—detailing their behavior, use‑cases, and providing concrete code examples for each.
ExecutorJavaMultithreading
0 likes · 6 min read

This article introduces Java thread pools, explaining their purpose, creation using ThreadPoolExecutor, execution flow, advantages such as resource reuse and management, common blocking queues, rejection policies, and provides multiple code examples of various pool types and a comprehensive monitoring example.
BlockingQueueConcurrencyExecutorService
0 likes · 11 min read


政采云技术Sep 13, 2023 · Backend Development
This article explains the concept of threads in Java, how to create them, the purpose and benefits of thread pools, the inheritance hierarchy of Java's Executor framework, key parameters of ThreadPoolExecutor, rejection policies, pool states, and the underlying working mechanism, supplemented with code examples.
ConcurrencyExecutorJava
0 likes · 15 min read

This article explains why using ThreadPoolExecutor directly is preferred over Executors, details the thread pool's purpose, internal architecture, task handling flow, state management, API parameters, queue choices, rejection policies, sizing formulas, and provides practical code examples for custom thread pool implementations.
BlockingQueueCustomThreadFactoryExecutorService
0 likes · 22 min read

This article explains the design of thread pools, when Java's ThreadPoolExecutor triggers rejection policies, details the four built‑in JDK policies and compares several third‑party implementations such as Dubbo, Netty, ActiveMQ and Pinpoint, helping developers choose the appropriate strategy for different scenarios.
ConcurrencyJavaRejectionPolicy
0 likes · 13 min read

This article demonstrates how a Spring Boot thread pool behaves when its core size, max size, and queue capacity are exceeded by multiple asynchronous tasks, explains the resulting TaskRejectedException, and shows how to configure built‑in or custom rejection policies to handle such scenarios.
AsyncConcurrencyJava
0 likes · 9 min read

Java's ThreadPoolExecutor offers four rejection policies—AbortPolicy, DiscardPolicy, DiscardOldestPolicy, and CallerRunsPolicy—each handling task overflow differently; this article explains their behavior, default setting, code examples, and how to configure them via Spring's ThreadPoolTaskExecutor for various business scenarios.
ConcurrencyJavaRejectionPolicy
0 likes · 9 min read

This article explains the four rejection policies of Java's ThreadPoolExecutor, shows the default AbortPolicy behavior, provides code examples for each policy, and demonstrates how to configure custom policies using both raw ThreadPoolExecutor and Spring's ThreadPoolTaskExecutor.
BackendJavaRejectionPolicy
0 likes · 8 min read

This article explores how a Java ThreadPoolExecutor behaves when a task triggers an OutOfMemoryError, demonstrates custom exception handling, compares the four built‑in rejection policies, and shows how to create a custom thread pool that records task execution time.
ConcurrencyCustomThreadPoolOutOfMemoryError
0 likes · 8 min read

This article explains the design principles of thread pools, when Java's ThreadPoolExecutor triggers rejection policies, details the four built‑in JDK policies with code examples, and explores additional strategies from Dubbo, Netty, ActiveMQ and Pinpoint, helping developers choose the right approach for their workloads.
BackendConcurrencyJDK
0 likes · 13 min read

This article explains the design principles of thread pools, the conditions that trigger rejection policies in Java's ThreadPoolExecutor, details the four built‑in JDK strategies, and reviews several third‑party implementations with their appropriate use‑cases, helping developers select the right policy for their workloads.
JavaRejectionPolicyThreadPoolExecutor
0 likes · 14 min read
