Programmer XiaoFu
Author

Programmer XiaoFu

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

111
Articles
0
Likes
419
Views
0
Comments
Recent Articles

Latest from Programmer XiaoFu

100 recent articles max
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.

JDK 21JavaSemaphore
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.

Function CallingLLMNamed Entity 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?
Programmer XiaoFu
Programmer XiaoFu
Mar 3, 2026 · Backend Development

Why Can a Redis Lock Be Stealed by Another Thread Before Its TTL Expires?

In high‑concurrency Java services, a Redis lock that appears to have a valid TTL can still be taken by another thread when a long Stop‑The‑World pause freezes the JVM clock, causing the lock to expire on Redis while the original holder remains paused, leading to data races.

Distributed LockFencing TokenFull GC
0 likes · 8 min read
Why Can a Redis Lock Be Stealed by Another Thread Before Its TTL Expires?
Programmer XiaoFu
Programmer XiaoFu
Jan 21, 2026 · Databases

How to Add a Column to a Tens‑Million‑Row Order Table Without Locking It

When a tens‑million‑row order table needs a new business column, directly running ALTER TABLE can lock the table and disrupt services, so the article explores master‑slave promotion, online DDL tools, schema‑less JSON extensions, and a clever use of an existing redundant column to achieve the change safely.

DDLJSONMySQL
0 likes · 7 min read
How to Add a Column to a Tens‑Million‑Row Order Table Without Locking It