Programmer XiaoFu
Author

Programmer XiaoFu

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

104
Articles
0
Likes
73
Views
0
Comments
Recent Articles

Latest from Programmer XiaoFu

100 recent articles max
Programmer XiaoFu
Programmer XiaoFu
May 29, 2026 · Backend Development

Why Does Spring Use a Third-Level Cache When the Second-Level Cache Can Resolve Circular Dependencies?

Spring’s bean factory uses a three‑level cache—singletonObjects, earlySingletonObjects, and singletonFactories—to handle circular dependencies, but only the third level is needed when AOP proxies are involved, allowing lazy proxy creation without breaking the standard bean lifecycle.

AOPBean LifecycleCircular Dependency
0 likes · 9 min read
Why Does Spring Use a Third-Level Cache When the Second-Level Cache Can Resolve Circular Dependencies?
Programmer XiaoFu
Programmer XiaoFu
May 27, 2026 · Backend Development

Why Does a ThreadPool Queue Tasks Even When Max Threads Are Idle?

The article explains why Java's ThreadPoolExecutor places tasks into a queue before creating non‑core threads, discusses the cost of thread creation and CPU contention, illustrates the design with a bank‑counter analogy, and shows how Tomcat customizes the queue to prioritize thread creation for low‑latency web workloads.

BlockingQueueJava concurrencyTaskQueue
0 likes · 8 min read
Why Does a ThreadPool Queue Tasks Even When Max Threads Are Idle?
Programmer XiaoFu
Programmer XiaoFu
May 19, 2026 · Backend Development

Why Does TraceId Get Mixed Up Under High Concurrency Even Though the Parent Thread Passes It to Child Threads?

The article explains why InheritableThreadLocal fails to propagate TraceId correctly in thread‑pool scenarios under high load, illustrates the problem with concrete request examples, and presents manual propagation and Alibaba's TransmittableThreadLocal as solutions.

InheritableThreadLocalJava concurrencyThreadPoolExecutor
0 likes · 7 min read
Why Does TraceId Get Mixed Up Under High Concurrency Even Though the Parent Thread Passes It to Child Threads?
Programmer XiaoFu
Programmer XiaoFu
May 8, 2026 · Backend Development

Can Java 21 Virtual Threads Render Thread Pools Obsolete?

The article examines how Java 21’s cheap virtual threads change the role of traditional thread pools, explaining why pooling virtual threads is a bad idea, how thread pools still act as natural throttlers, and which scenarios—especially CPU‑bound work and synchronized blocks—remain unsuitable for virtual threads.

ConcurrencyJDK 21Java
0 likes · 8 min read
Can Java 21 Virtual Threads Render Thread Pools Obsolete?
Programmer XiaoFu
Programmer XiaoFu
May 6, 2026 · Cloud Native

Why Add an API Gateway for Internal Services When Direct Connection Is Possible?

The article explains why, despite the apparent speed of direct internal service calls, using an API gateway provides essential benefits such as unified governance, version‑aware routing, protocol translation, security isolation, and high‑availability traffic buffering, making it a worthwhile trade‑off in most microservice environments.

API GatewayInternal NetworkProtocol Translation
0 likes · 7 min read
Why Add an API Gateway for Internal Services When Direct Connection Is Possible?
Programmer XiaoFu
Programmer XiaoFu
Apr 20, 2026 · Artificial Intelligence

How Java + LangChain4j Can Eliminate Messy Chunking for High‑Quality RAG Document Splitting

The article explains why fixed‑size chunking harms RAG recall, demonstrates three semantic‑chunking strategies—including recursive punctuation splitting, overlapping windows, and parent‑child document mapping—and provides complete Java/LangChain4j code that integrates tokenizers, Redis, and Qdrant to boost retrieval performance.

EmbeddingJavaLangChain4j
0 likes · 10 min read
How Java + LangChain4j Can Eliminate Messy Chunking for High‑Quality RAG Document Splitting
Programmer XiaoFu
Programmer XiaoFu
Apr 13, 2026 · Artificial Intelligence

Why Prompt‑Based JSON Extraction Breaks LLM‑Driven Intent and NER

The article explains how using plain prompts to force large language models to output JSON for intent recognition and named‑entity extraction leads to unpredictable extra text, key mismatches, and hallucinated fields, and it presents three robust alternatives—placeholders, function calling, and constrained decoding—to achieve reliable structured outputs.

Constrained DecodingFunction CallingIntent Recognition
0 likes · 8 min read
Why Prompt‑Based JSON Extraction Breaks LLM‑Driven Intent and NER
Programmer XiaoFu
Programmer XiaoFu
Mar 27, 2026 · Artificial Intelligence

Top 5 Java AI Frameworks for Enterprise Applications

This article analyzes the emerging Java AI ecosystem, comparing Spring AI, LangChain4j, Spring AI Alibaba, AgentScope‑Java, and Microsoft Semantic Kernel, and provides guidance on selecting the right framework based on features such as RAG, agent support, observability, security sandbox, and cloud integration.

AI frameworksAgentScopeJava
0 likes · 19 min read
Top 5 Java AI Frameworks for Enterprise Applications
Programmer XiaoFu
Programmer XiaoFu
Mar 18, 2026 · Cloud Native

Why Does Traffic Still Hit a Shut‑Down Instance After Clicking “Offline” in Nacos?

The article explains that Nacos‑based service deregistration is not instantly reflected in client load‑balancer caches due to periodic polling and unreliable UDP pushes, leading to a delay where gateways still route requests to a terminated instance, and then presents step‑by‑step lossless shutdown solutions for small teams and large‑scale deployments.

Graceful ShutdownKubernetesLoad Balancer
0 likes · 8 min read
Why Does Traffic Still Hit a Shut‑Down Instance After Clicking “Offline” in Nacos?