Programmer XiaoFu
Author

Programmer XiaoFu

xiaofucode.com – a programmer learning guide driven by the pursuit of profit

108
Articles
0
Likes
140
Views
0
Comments
Recent Articles

Latest from Programmer XiaoFu

100 recent articles max
Programmer XiaoFu
Programmer XiaoFu
Feb 5, 2025 · Backend Development

Elegant Ways to Capture Exceptions from Java ThreadPool Tasks

This article explains why tasks submitted with ExecutorService.submit hide exceptions while execute prints them, demonstrates how Future.get() can retrieve hidden errors, and presents three practical solutions—inline try‑catch, a custom ThreadFactory with UncaughtExceptionHandler, and overriding afterExecute—to reliably handle thread‑pool exceptions in Java.

ExceptionHandlingFutureThreadPool
0 likes · 15 min read
Elegant Ways to Capture Exceptions from Java ThreadPool Tasks
Programmer XiaoFu
Programmer XiaoFu
Dec 26, 2024 · Backend Development

Avoid Misusing Spring Event: 6 Hard‑Earned Best Practices from a Real‑World Failure

The article recounts a production incident caused by improper use of Spring Event, explains why graceful shutdown, correct startup timing, suitable business scenarios, and reliability measures such as retries and idempotency are essential, and presents six concrete best‑practice recommendations to prevent similar failures.

Backend developmentGraceful shutdownIdempotency
0 likes · 11 min read
Avoid Misusing Spring Event: 6 Hard‑Earned Best Practices from a Real‑World Failure
Programmer XiaoFu
Programmer XiaoFu
Dec 18, 2024 · Industry Insights

ByteDance and Kuaishou Launch Anti‑Jargon Campaign: From WC Posters to Clear Communication

ByteDance and Kuaishou have launched an “anti‑jargon” campaign, posting restroom cartoons that urge employees to abandon buzzwords like “赋能” and “抓手,” arguing that such jargon hampers clear communication, reduces efficiency, and fuels overtime, while also serving as a status symbol within the tech industry.

ByteDanceKuaishoucommunication
0 likes · 5 min read
ByteDance and Kuaishou Launch Anti‑Jargon Campaign: From WC Posters to Clear Communication
Programmer XiaoFu
Programmer XiaoFu
Dec 12, 2024 · Backend Development

4 Elegant Ways to Transfer Data Between Async Threads in Spring Boot

The article compares four techniques—manual ThreadLocal copying, TaskDecorator, InheritableThreadLocal, and Alibaba's TransmittableThreadLocal—for passing user context and other data from parent to child threads in Spring Boot async execution, recommending the TaskDecorator and TransmittableThreadLocal approaches for production use.

AsyncJavaSpring Boot
0 likes · 13 min read
4 Elegant Ways to Transfer Data Between Async Threads in Spring Boot
Programmer XiaoFu
Programmer XiaoFu
Dec 4, 2024 · Information Security

Designing Elegant and Secure Third‑Party APIs: Key Practices and Pitfalls

The article presents a comprehensive design for third‑party APIs that protects against data tampering, replay attacks, and unauthorized access by using AK/SK key pairs, timestamp and nonce signatures, TLS encryption, fine‑grained permission models, rate limiting, idempotency handling, versioning, standardized response formats, and detailed implementation examples in Java.

AK/SKAPI SecurityREST API
0 likes · 32 min read
Designing Elegant and Secure Third‑Party APIs: Key Practices and Pitfalls
Programmer XiaoFu
Programmer XiaoFu
Nov 27, 2024 · Databases

Why Does MySQL CPU Spike to 900%? Diagnosis and Fixes

The article explains how to troubleshoot extreme CPU usage in MySQL and Java processes, detailing step‑by‑step diagnostics with top, show processlist, jstack, and practical fixes such as adding missing indexes, disabling slow logs, using caches, and correcting busy‑loop code to bring CPU consumption back to normal levels.

IndexingJavaLinux
0 likes · 11 min read
Why Does MySQL CPU Spike to 900%? Diagnosis and Fixes
Programmer XiaoFu
Programmer XiaoFu
Nov 22, 2024 · Backend Development

15 Must-Know SpringBoot Startup Extension Points – Which Have You Used?

This article enumerates fifteen common SpringBoot startup extension points, explains their positions in the bean lifecycle, illustrates each with concrete code snippets and usage scenarios, and provides a visual call‑order diagram to help developers harness these hooks for custom initialization and middleware development.

BeanLifecycleExtensionPointsJava
0 likes · 18 min read
15 Must-Know SpringBoot Startup Extension Points – Which Have You Used?
Programmer XiaoFu
Programmer XiaoFu
Nov 19, 2024 · Backend Development

When Stream Makes Your Java Code Look Ugly: Pitfalls and Clean‑up Tips

The article examines how Java Stream and Lambda, while designed for concise and expressive code, often become sources of unreadable and hard‑to‑maintain implementations, and it offers concrete refactoring techniques, proper use of Optional, and cautions about ParallelStream performance.

Code styleLambdaOptional
0 likes · 8 min read
When Stream Makes Your Java Code Look Ugly: Pitfalls and Clean‑up Tips
Programmer XiaoFu
Programmer XiaoFu
Nov 16, 2024 · Backend Development

How Leading Companies Implement Distributed Caching – Lessons and Pitfalls

The article examines the benefits and hidden risks of using distributed caches, analyzes real‑world failure cases from Facebook, Google and AWS, and provides detailed strategies to mitigate availability and consistency problems through careful refresh policies, incremental updates, and compensation mechanisms.

Cache ConsistencyCache DesignDistributed cache
0 likes · 19 min read
How Leading Companies Implement Distributed Caching – Lessons and Pitfalls