Fading Coder

One Final Commit for the Last Sprint

Configuring Multiple Data Sources in a Spring Boot Application

Configuring Multiple Data Sources in Spring Boot To support heterogeneous database access—such as reading from both MySQL and PostgreSQL—Spring Boot applications can be configured with multiple data sources using dynamic routing. Dependency Setup Add the following dependencies to pom.xml: <depend...

Establishing Full-Duplex Real-Time Connections Using WebSocket and Spring Boot

Protocol Fundamentals WebSocket defines a standardized method for opening persistent, bidirectional channels over a single Transmission Control Protocol (TCP) socket. After an initial negotiation phase, both the client and backend can independently exchange data streams without adhering to tradition...

Essential Configuration Changes When Upgrading to Spring Boot 2.x

Redis Connection Factory Configuration Spring Boot 2.x introduces significant changes to Redis auto-configuration. The Jedis client setup requires explicit bean definitions with updated APIs. Required Dependency <dependency> <groupId>org.springframework.boot</groupId> <artifactI...

Understanding Spring Boot Core Concepts and Autoconfiguration

Spring is an open-source, full-stack Java framework centered around inversion of control and aspect-oriented programming. While its foundational abstractions are applicable across any Java application, Spring has evolved extensively to support enterprise web development—largely supplanting legacy EJ...

HTTP POST Implementation for Sending Array Parameters with Java and Spring

When developing client applications that need to transmit collections of data to a server endpoint, utilizing an HTTP POST request is the standard approach. Specifically, scenarios involving batch operations often require sending an array of identifiers or objects. To handle this on the client side...

Deploying MinIO for Object Storage with Spring Boot Integration

Windows Environment Setup MinIO is a lightweight, high-performance object storage system written in Go. It provides an S3-compatible API and is suitable for local deployments or on-premise infrastructure. Local Installation Download the windows-amd64 executable from the official repository. Place mi...

Spring Boot Test Injection Failure Troubleshooting

Unit Test Template @RunWith(SpringRunner.class) //@SpringBootTest(classes = PersonConfig.class) @ContextConfiguration(classes = PersonConfig.class) class Test { @Resource private PersonEventService personEventService; @Test public void test() { // ApplicationContext context = new AnnotationConfigApp...

Implementing High-Concurrency Product Flash Sale System with Spring Boot

System Initialization Initialize product inventory in Redis for caching: @RestController public class FlashSaleController { @Autowired private RequestAggregatorService aggregator; @Autowired private RedisTemplate<String, Object> cache; @PostMapping("/purchase") public ApiResponse pro...

Resolving ServerContainer Not Available Error in Spring Boot WebSocket Tests

When running test classes in a Spring Boot application with WebSocket integration, you may encounter the error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverEndpointExporter' Invocation of init method failed; nested exception is java.lang.IllegalState...

Separating Dependencies for Gradle Multi-Module Spring Boot Applications

Project Hierarchy . ├── acme-utils │ ├── build.gradle.kts │ └── src ├── acme-domain │ ├── build.gradle.kts │ └── src ├── acme-repository │ ├── build.gradle.kts │ └── src ├── acme-security │ ├── build.gradle.kts │ └── src ├── acme-app-runner │ ├── build.gradle.kts │ └── src ├── buildSrc │ ├── build │...