Shepherd Advanced Notes
Author

Shepherd Advanced Notes

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

122
Articles
0
Likes
0
Views
0
Comments
Recent Articles

Latest from Shepherd Advanced Notes

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

Distributed TracingLogbackMDC
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.

Distributed LockJavaRedis
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 LifecycleDependency InjectionSingleton
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
Shepherd Advanced Notes
Shepherd Advanced Notes
Apr 19, 2023 · Backend Development

Spring Extension Point (Part 1): Understanding PostProcessor Mechanisms

This article explains Spring's core post‑processor extension points—BeanDefinitionRegistryPostProcessor, BeanFactoryPostProcessor, and BeanPostProcessor—detailing their purpose, execution order, concrete code examples, and how they fit into the bean lifecycle, including advanced interfaces like InstantiationAwareBeanPostProcessor.

Bean LifecycleDependency InjectionJava
0 likes · 14 min read
Spring Extension Point (Part 1): Understanding PostProcessor Mechanisms