Fading Coder

One Final Commit for the Last Sprint

Dynamic Rule Configuration and DataSource Extensions in Sentinel

Sentinel treats resource definition as the primary developer concern. Once resources are defined, flow control and circuit breaker rules can be attached dynamically. Two core mechanisms exist for rule updates: Direct API manipulation through dedicated manager classes: FlowRuleManager.loadRules(List&...

Understanding Recursive Method Calls in Java

Recursive Method Invocation in Java Consider the following code structure: public class RecursionDemo { public static void main(String[] args) { System.out.println("Program starts"); execute(); System.out.println("Program terminates"); } public static void execute() { System.out....

Java Fundamentals: Core Syntax Overview

1. Comments Java supports three types of comments: Single-line: // comment text Multi-line: /* comment text */ Documentation: /** comment text */ — used for generating API documentation. 2. Keywords Keywords are reserved words with predefined meanings in Java and cannot be used as identifiers (e.g.,...

Using High-Level REST Client to Manage Elasticsearch

This article demonstrates how to manage Elasticsearch using the High-Level REST Client. It covers connecting to a Elasticsearch cluster, creating indices, and checking their existence. The following example shows how to establish a connection with basic authentication and perform operations like ind...

Implementing Today's Best Match and User Recommendation with Caching

Homepage feature explanation System architecture overview Implementing the 'Today's Best Match' feature Implementing the recommended users list Adding caching to API endpoints Integration testing with the frontend 1. Homepage After successful login, users enter the homepage. The homepage features i...

Implementing File Compression and Extraction in Java

Extracting ZIP FilesTo decompress a ZIP archive, we utilize the ZipInputStream class to read the entries sequentially. The following implementation defines a destination directory based on the archive name, ensuring that any pre-existing directory is removed before extraction begins. This cleanup pr...

Executing Asynchronous Tasks with CompletableFuture in Java

Understanding the Future Interface The Future interface (implemented by FutureTask) provides methods for managing asynchronous task execution, including retrieving execution results, canceling tasks, checking cancellation status, and determining completion status. Future enables main threads to offl...

Formatting Dates with printf in Java

Using printf for Date and Time Formatting The printf method provides a straightforward way to format dates and times in Java. Format specifiers start with %t folllowed by a single letter that determines the output format. Conversion Character Description Example Output c Complete date and time Sat O...

Building a Java Utility for Parallel Batch Data Processing

Processing large datasets efficiently often requires parallel execution to maximize throughput. A reusable multi-threaded utility allows developers to focus on business logic while the framework handles thread management and data partitioning. Response Wrapper Class The ApiResponse class provides a...

Java Implementation of Observer Pattern for Object Interaction

Observer Pattern Fundamentals Observer pattern establishes dependency relationships between objects, enabling automatic notifications when one object changes state. The changing object (subject) automatical informs its dependent objects (observers), which then react accordingly. This pattern support...