Shepherd Advanced Notes
Author

Shepherd Advanced Notes

Dedicated to sharing advanced Java technical insights, daily work snippets, and the power of persistent effort.

123
Articles
0
Likes
167
Views
0
Comments
Recent Articles

Latest from Shepherd Advanced Notes

100 recent articles max
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 24, 2023 · Backend Development

Understanding the Core Principles of Spring AOP Aspect Programming

This article explains how Spring AOP integrates AspectJ using CGLIB or JDK dynamic proxies, walks through a complete logging aspect example, and details the internal registration, proxy creation, and invocation processes that enable cross‑cutting concerns without modifying business code.

AOPAspectJCGLIB
0 likes · 15 min read
Understanding the Core Principles of Spring AOP Aspect Programming
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 17, 2023 · Fundamentals

How to Pass Values Between Parent and Child Threads with InheritableThreadLocal and TransmittableThreadLocal

The article explains why regular ThreadLocal cannot share data from a parent thread to its child, introduces InheritableThreadLocal as a built‑in solution, shows its limitation with thread‑pool reuse, and demonstrates how Alibaba's TransmittableThreadLocal overcomes this issue with concrete code examples and output.

InheritableThreadLocalJavaThreadLocal
0 likes · 10 min read
How to Pass Values Between Parent and Child Threads with InheritableThreadLocal and TransmittableThreadLocal
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 4, 2023 · Backend Development

Implement Distributed Log Tracing in Spring Boot with MDC and traceId

This guide explains how to add a unique traceId to each request in a Spring Boot application, configure Logback/MDC to record it, propagate the ID across microservice calls and asynchronous threads using OpenFeign, RestTemplate, and TransmittableThreadLocal, enabling complete distributed log tracing.

MDCOpenFeignTransmittableThreadLocal
0 likes · 18 min read
Implement Distributed Log Tracing in Spring Boot with MDC and traceId
Shepherd Advanced Notes
Shepherd Advanced Notes
Jun 27, 2023 · Backend Development

Implementing Distributed Locks in Spring Boot with Redisson

This article explains how Redisson extends Redis to provide a rich set of distributed Java objects and services, walks through integrating Redisson into a Spring Boot project, demonstrates various lock types (reentrant, read‑write, semaphore, latch) with code examples, and details the internal watchdog mechanism that guarantees atomic lock acquisition and automatic renewal.

JavaRedissonSemaphore
0 likes · 19 min read
Implementing Distributed Locks in Spring Boot with Redisson
Shepherd Advanced Notes
Shepherd Advanced Notes
Jun 19, 2023 · Backend Development

Elegant Unified Response and Global Exception Handling in Spring Boot

The article explains how Spring Boot projects can adopt a standard JSON response structure using a generic ResponseVO class and achieve automatic wrapping and global exception handling through a custom @ResponseResultBody annotation combined with ResponseBodyAdvice and @ControllerAdvice, reducing repetitive code and improving robustness.

ResponseBodyAdviceResponseVORestControllerAdvice
0 likes · 14 min read
Elegant Unified Response and Global Exception Handling in Spring Boot
Shepherd Advanced Notes
Shepherd Advanced Notes
Jun 12, 2023 · Backend Development

How Spring Solves Circular Bean Dependencies with a Three‑Level Cache

The article explains Spring's three‑level cache mechanism for resolving singleton circular bean dependencies, walks through bean lifecycle stages, compares field, setter and constructor injection, shows configuration to enable circular references, and details the internal code paths that expose early bean references.

Bean LifecycleCircular DependencySpring
0 likes · 17 min read
How Spring Solves Circular Bean Dependencies with a Three‑Level Cache
Shepherd Advanced Notes
Shepherd Advanced Notes
May 8, 2023 · Backend Development

Elegant Ways to Boost API Data Security in Spring Boot

The article explains how to protect Spring Boot APIs from unauthorized data access by adding data‑level permission checks, encrypting request parameters with AES and RSA, signing requests with SHA1WithRSA, and encapsulating the logic in a reusable @ApiSecurity annotation and AOP aspect.

AOPAPI securityAnnotation
0 likes · 22 min read
Elegant Ways to Boost API Data Security in Spring Boot