This article analyzes how OpenFeign's default timeout and hidden retry layers (Feign, LoadBalancer, HttpClient, Nginx) cause duplicate requests, demonstrates a reproducible case where a 12-second downstream service triggers three retries creating duplicate orders, and presents a database unique-index idempotency pattern to prevent duplicates.
This article compares four Java approaches for calling WebServices — Axis2 code generation, RPC, HttpURLConnection, and HttpClient — detailing pros, cons, code samples, and a real-world namespace mismatch issue when integrating with C-based services.
JDK 26 adds HttpRequest.BodyPublishers.ofFileChannel, letting developers read specific file segments directly from a shared FileChannel without copying data into heap memory, dramatically reducing memory usage and simplifying parallel chunk uploads to object storage such as OSS or S3.
This article explains how to invoke external services from a Spring Boot application using three approaches—raw HttpClient, Spring's RestTemplate, and Feign—providing code examples, configuration steps, and tips for handling headers and tokens.
This article demonstrates three methods for invoking external services in Spring Boot applications—using raw HttpClient, the RestTemplate utility, and Feign clients—providing code examples, configuration steps, and tips for handling headers and tokens to simplify integration without Dubbo.
This article introduces a continuously updated collection of 151 Spring Boot 3 practical examples, covering built‑in retry mechanisms, concurrency limits, and automatic HTTP client registration, complete with configuration snippets, code samples, and visual illustrations to help developers implement resilient backend services.
This article demonstrates three methods for invoking external services in a Spring Boot application—using raw HttpClient, the RestTemplate utility, and Feign clients—providing code examples, configuration steps, and tips for handling headers and tokens.
This article presents eight practical retry mechanisms for Java applications—including loop, recursion, HttpClient configuration, Spring Retry, Resilience4j, custom utilities, asynchronous thread‑pool retries, and message‑queue based retries—along with code examples, configuration snippets, and best‑practice guidelines to help developers handle transient network failures reliably.
This article demonstrates three approaches for invoking external services in Spring Boot applications—using raw HttpClient, the RestTemplate utility, and Feign clients—providing code samples, configuration steps, and tips for handling headers and tokens.
This article demonstrates three practical approaches for invoking external services in a Spring Boot application—using a raw HttpClient, the RestTemplate utility, and the Feign declarative client—complete with code examples, configuration steps, and tips for handling headers and tokens.
This article explains why retry mechanisms are essential for unreliable network calls in distributed systems and presents eight concrete Java implementations—including loop, recursion, HttpClient built‑in, Spring Retry, Resilience4j, custom utilities, asynchronous thread‑pool, and message‑queue approaches—plus best‑practice guidelines to avoid common pitfalls.
This article explains how to improve a high‑traffic Java service by reusing a singleton HttpClient, enabling keep‑alive, configuring a pooling connection manager, and adding an idle‑connection monitor, which reduces average request latency from 250 ms to about 80 ms.
This article explains why and how to replace OpenFeign with native Spring HttpInterface alternatives such as Apache HttpClient, OkHttp, and RestTemplate, covering security motivations, configuration details, code examples, and practical recommendations for microservice remote calls.
This article walks through eight practical ways to implement retry mechanisms for remote API calls in Java, covering simple loops, recursion, Apache HttpClient settings, Spring Retry, Resilience4j, custom utilities, asynchronous thread‑pool retries, and message‑queue based retries, while highlighting trade‑offs and best‑practice guidelines.
This article walks through a real‑world performance overhaul of Apache HttpClient—using a singleton client, connection pooling, a custom keep‑alive strategy, timeout tuning, and idle‑connection monitoring—to reduce average request time from 250 ms to about 80 ms for a high‑throughput service.
This article details a step‑by‑step optimization of Apache HttpClient—including connection pooling, keep‑alive, singleton client usage, timeout tuning, and response handling—to reduce average request latency from 250 ms to about 80 ms in a high‑throughput Java service.
This article explains why retry mechanisms are essential for distributed Java applications and walks through eight practical implementations—including loop, recursion, Apache HttpClient, Spring Retry, Resilience4j, custom utilities, asynchronous thread‑pool retries, and message‑queue based retries—plus best‑practice guidelines to avoid common pitfalls.
This article introduces multiple Java approaches for sending HTTP GET and POST requests, covering the built‑in HttpURLConnection class, Apache HttpClient, Square's OkHttp, and Spring's RestTemplate, with step‑by‑step explanations and complete code examples for each method.
This article presents eight practical ways to implement retry mechanisms for third‑party API calls in Java, covering simple loops, recursion, built‑in HttpClient handlers, Spring Retry, Resilience4j, custom utilities, asynchronous thread‑pool retries, and message‑queue based retries, plus best‑practice guidelines.
This article demonstrates how to invoke external services from a Spring Boot application by using raw HttpClient, the RestTemplate utility, and Feign client, providing complete code examples, configuration steps, and tips for handling headers and tokens.
This article details how to dramatically improve the performance of a million‑level QPS Java service by reusing a singleton HttpClient, enabling keep‑alive connection pooling, and handling responses efficiently, cutting average request time from 250 ms to about 80 ms.
This article explains how to dramatically improve the performance of a high‑traffic Java service by reusing a singleton HttpClient, enabling connection pooling and keep‑alive, tuning timeout and retry settings, and adding an idle‑connection monitor to reduce average request latency from 250 ms to about 80 ms.
This article explains how to dramatically reduce HttpClient request latency from 250 ms to about 80 ms in a high‑traffic service by using a singleton client, connection pooling, keep‑alive strategies, proper timeout settings, and efficient response handling, complete with code examples.
By refactoring a high‑traffic Java service to use a singleton HttpClient, enable connection pooling with a custom keep‑alive strategy, and fine‑tune timeout and retry settings, the average request time dropped from 250 ms to about 80 ms, dramatically improving throughput and stability.
This article details practical optimization techniques for Apache HttpClient—including connection pooling, keep-alive, singleton client usage, proper timeout settings, and asynchronous handling—to reduce average request latency from 250 ms to about 80 ms in a ten-million-calls-per-day service.
This article explains how to invoke external services from a Spring Boot application using three approaches—raw HttpClient, Spring's RestTemplate, and Feign—providing detailed code examples, configuration steps, and tips for handling headers and tokens.
Learn how to integrate external HTTP services in Spring Boot by using raw HttpClient, the RestTemplate utility, and declarative Feign clients, with detailed code examples, token handling, and configuration tips for each approach.
This article demonstrates three methods for invoking external services in Spring Boot applications—using raw HttpClient, the RestTemplate utility, and Feign clients—providing code examples, configuration steps, and usage details for each approach in production.
This article explains how to invoke external services from a Spring Boot application using three approaches—raw HttpClient requests, Spring's RestTemplate utilities, and Feign clients—providing code examples, configuration steps, and tips for handling headers and tokens.
This article demonstrates three practical approaches—native HttpClient, Spring's RestTemplate, and Feign client—to invoke external services from a Spring Boot application, providing code examples, configuration details, and tips for handling authentication tokens.
This article explains how to invoke external APIs in a SpringBoot application using three approaches—raw HttpClient, RestTemplate, and Feign—detailing configuration, code examples for GET and POST requests, token handling, and header interception.
This article explains how to invoke external services from a Spring Boot application using three approaches—raw HttpClient, Spring's RestTemplate, and Feign client—providing detailed code examples, configuration steps, and tips for handling headers and tokens.
This article explains three methods for invoking external services in Spring Boot applications—using a raw HttpClient, the RestTemplate utility, and Feign clients—providing code examples, configuration steps, and tips for handling headers and tokens.
This article explains how to invoke external services from a Spring Boot application using three approaches—raw HttpClient, RestTemplate, and Feign—providing code examples, configuration steps, and tips for handling headers and tokens to ensure successful API communication.
This article introduces Java 11's built-in HttpClient, compares it with legacy HttpURLConnection and third-party libraries, and provides detailed code examples for creating and configuring HttpRequest objects, sending synchronous and asynchronous requests, handling headers, timeouts, bodies, and demonstrates a custom mica-http wrapper for practical use.
This guide demonstrates how to use Java 11’s HttpClient to build a WebSocket client, implement a listener for various message events, and send both text and binary data, including a complete runnable example that showcases connection setup, message handling, and periodic sending.
Learn how Java 11’s built‑in HttpClient simplifies both synchronous and asynchronous HTTP calls, covering client and request creation, setting URIs, methods, headers, timeouts, and various body types, with complete code examples and a comparison to alternative libraries.
This article explains why browsers enforce same‑origin policies causing CORS problems, outlines common remedies such as the @CrossOrigin annotation, HttpClient usage, and Spring Cloud Gateway integration, and provides detailed configuration and code examples for implementing these solutions in a Java backend.
This article provides a step‑by‑step tutorial on creating a SpringBoot demo that integrates Apache HttpClient for GET/POST requests, handles token acquisition and caching with Redis, optimizes configuration via application.yml, and implements distributed locking and Guava‑based rate limiting for high‑concurrency scenarios.
The article explains why browsers enforce same‑origin policies, then presents three practical ways to solve cross‑origin issues in a Spring Boot backend—using the @CrossOrigin annotation, routing through Spring Cloud Gateway, and making server‑side requests with HttpClient—accompanied by configuration examples and full code snippets.
This article explains why browsers enforce same‑origin policies, presents common CORS solutions such as the @CrossOrigin annotation, gateway integration with Spring Cloud Gateway, and using HttpClient, and provides detailed configuration and code examples for implementing these approaches in a Java backend project.
This article explains why browsers enforce same‑origin policies, presents common CORS solutions such as the @CrossOrigin annotation, HttpClient usage, and Spring Cloud Gateway integration, and provides detailed code examples for configuring gateways, CORS filters, and making HTTP requests in Java backend projects.
This article compares Java’s HttpClient timeout implementation with Go’s built‑in HttpClient, explains Go’s Context‑based timeout mechanism, walks through the underlying source code, and shows why Java cannot easily replicate the same approach due to differences in concurrency primitives.
This article explains why cross‑origin issues occur, presents common solutions such as @CrossOrigin, HttpClient and Spring Cloud Gateway, and provides detailed code examples for configuring CORS, building a gateway module, and making HTTP requests in a Java backend project.
The article investigates frequent HttpClient connection‑pool exhaustion caused by excessive CLOSE_WAIT sockets in a high‑traffic Java service, explains the underlying TCP and HttpClient mechanisms, presents diagnostic commands and code snippets, and offers concrete configuration and architectural recommendations to prevent similar issues.
This article explains multiple approaches for invoking third‑party HTTP APIs in Java, covering JDK HttpURLConnection, Apache HttpClient, CloseableHttpClient, SpringBoot RestTemplate, and OkHttp, with detailed code examples, configuration steps, and usage patterns for GET and POST requests.
An in‑depth analysis of a production incident where HttpClient connections accumulated in CLOSE_WAIT, covering symptom identification, TCP state inspection, root‑cause debugging, HttpClient pool internals, and practical configuration tweaks to prevent similar outages.
This article explains how to dramatically reduce the average response time of a high‑traffic Java service from 250 ms to about 80 ms by applying HttpClient pooling, keep‑alive strategies, proper timeout settings, and idle‑connection monitoring, complete with code examples and configuration details.
This article demonstrates two Python approaches—using high-level requests and low-level HTTPConnection—to fetch intraday stock data from Eastmoney, providing complete code examples, URL discovery steps, and practical tips for data‑mining enthusiasts.
The article explains how the Builder pattern helps simplify object creation when a class has many required and optional parameters, using Java's HttpClient and HttpRequest examples to demonstrate fluent configuration and reduce constructor overloads.
This article explains how C# source generators introduced in .NET 5/6 can analyze compile‑time metadata and automatically generate HttpClient implementation classes, register them in the DI container, and handle multi‑project assembly analysis for streamlined API consumption.
This article explains why the default InMemoryDnsResolver cannot provide load balancing, shows how to create a custom SystemDefaultDnsResolver that randomly selects IPs, and demonstrates single‑thread, multi‑thread, and single‑connection pool tests to verify the behavior.
This curated list compiles numerous Chinese-language articles and tutorials covering API and interface testing techniques, including Java HttpClient usage, Spring Boot integration, socket and WebSocket testing, performance measurement, automation frameworks, and related tools, offering developers practical guidance for backend service validation.
This article walks through Java 11’s most useful enhancements—including new String methods, simplified collection‑to‑array conversion, predicate negation, var in lambda parameters, streamlined file I/O, nested class access rules, and HTTP/2 support—providing concise code examples for each feature.
Java 9 introduces several notable enhancements—including immutable collection factories, expanded Stream operations like ofNullable, iterate, takeWhile, dropWhile, new Optional methods, simplified try‑with‑resources, private interface methods, a modern HttpClient, and preliminary Flow support—each illustrated with concise code examples for developers transitioning from earlier Java versions.
This article compares Apache HttpClient and OkHttp for Java backend development, explaining how to create clients, configure timeouts, perform GET/POST/PUT/DELETE requests, upload files, cancel requests, and presents performance test results with code examples for each library.
This tutorial walks through building HTTP interface tests with the FunTester framework in Java, covering request types (GET, POST), headers, cookies, response parsing, JSON handling, and resource cleanup, and provides code examples for each step.
This article explores the practical impact of asynchronous HTTP requests in Java NIO‑based performance testing, detailing server setup with Moco, baseline measurements, various async implementations, and the trade‑offs between raw speed gains and CPU consumption.
This article explains how Java NIO's non‑blocking I/O can accelerate HTTP interface testing by offloading response handling to separate threads, presents a simple request‑time model, and provides concrete async HttpClient code examples with logging and JSON parsing.
This article demonstrates how to call third‑party APIs in Java projects by importing the HttpClientUtil utility, performing GET and POST requests (with and without parameters), handling JSON responses with a custom JsonUtils class, and includes complete code examples for each step.
This article explains why HTTP lacks confidentiality, introduces symmetric, asymmetric, and hybrid encryption, describes the HTTPS handshake steps, and shows how Apache HttpClient builds SSL connections with code examples, highlighting key components such as SSLConnectionSocketFactory and HostnameVerifier.
The article documents a systematic investigation of why an Apache HttpClient‑based utility class fails to reuse connections, reproduces the problem with a test server and client, analyzes Tomcat's default maxKeepAliveRequests limit of 100, and provides recommendations for configuration.
The article recounts a real‑world incident where a Java HttpClient connection‑pool misconfiguration limited each host to only two connections, causing massive thread queuing, CPU spikes, and ultimately a cascade of instance crashes during traffic scaling.
The second FunTester sharing session covered HttpClient basics, FunTester’s encapsulation of HttpClient, and practical functional and performance testing techniques, providing resources, code examples, and templates for effective Java interface testing.
The article demonstrates how to configure API endpoints and use Java's Apache HttpClient to retrieve authentication cookies and perform subsequent requests, providing a full code example for beginners in interface automation testing.
This tutorial demonstrates how to build a Spring Boot Maven project that fetches random sentences from an online API, configures JavaMail with POP3/SMTP credentials, and uses a scheduled task to automatically send emails, including deployment tips for Linux and Windows.
A detailed post explains how a mis‑configured HttpClient caused thread explosion and OOM on four servers, walks through the investigation using APM metrics, clarifies keep‑alive mechanics, and presents the fix of using a singleton HttpClient with proper connection eviction.
This article compares four Java HTTP client options—HttpURLConnection, Apache HttpComponents HttpClient, the Java 9 HttpClient, and OkHttp—detailing their features, code examples, configuration capabilities, and suitability for projects that need connection pooling, DNS control, form/JSON support, and synchronous or asynchronous calls.
This guide explains why Java 11 is worth adopting, lists its major language and API enhancements over Java 8—including var type inference, improved collections, stream and HTTP client APIs—and provides detailed solutions for common migration issues such as missing JAXB modules and container‑aware JVM behavior.
The article recounts a production OOM incident triggered by a misconfigured HttpClient evictExpiredConnections setting that caused uncontrolled thread growth, explains the underlying keep‑alive TCP behavior and NoHttpResponseException, and presents the corrective measures of using a singleton HttpClient and proper connection‑pool monitoring.
A high‑traffic promotion system suffered massive thread‑pool exhaustion and service outages due to an incorrectly configured HttpClient connection pool, leading to port binding failures, CPU spikes, and instance crashes; the post details the diagnosis, root cause, and concrete mitigation steps.
An engineer recounts how a high‑traffic promotion system suffered port exhaustion and thread‑pool overload due to a default max‑connections‑per‑host setting of two, leading to CPU spikes, process crashes, and a cascading failure, and outlines the investigation steps and preventive measures.
The author describes how a high‑traffic promotion system using HttpClient suffered massive thread and port exhaustion due to misconfigured connection‑pool parameters, details the investigation steps—including monitoring, jstack analysis, and source code review—and outlines corrective measures and preventive testing strategies.
This article explains how to extend a testing framework with a FunRequest class that records HTTP request and response details, provides fluent setters, supports GET and POST, and enables saving and reproducing requests for faster bug diagnosis.
This article explains why a separate HttpRequestBase object is needed for each concurrent request in a performance testing framework, and provides a complete Java implementation of a FunRequest class that offers deep‑copy, cloning, and fluent configuration of GET/POST HTTP requests.
The article shares two years of backend testing experience using Java and Groovy, detailing a custom HttpClient‑based testing framework with MySQL storage, HTML reporting, alert notifications, and a comprehensive collection of API testing, performance testing, and test‑design resources.
This article investigates the root causes of excessive TCP CLOSE_WAIT connections in a Java service, explains TCP state transitions, demonstrates packet capture analysis, and details how improper use of Apache HttpClient and its connection pool leads to lingering sockets, offering concrete debugging steps and configuration fixes.
This guide explains why Java HTTPS requests can fail with an SSLHandshakeException, covering the JCE unlimited‑strength policy replacement and TLS version mismatches, and provides complete code snippets for creating a permissive SSLContext and a pooled HttpClient to resolve the issue.
This tutorial shows how to encapsulate a reusable Java HttpClient method that builds a multipart/form-data request, iterates over parameters, attaches binary file streams or text parts, and sets the resulting entity on an HttpPost object, with a Linux‑specific note.
This article explains how to use Java HttpClient to call a login API, retrieve authentication cookies, and programmatically inject them into a Selenium WebDriver session, enabling automated tests to run in a logged‑in state without manual UI login.
This article walks through improving a Java GET‑parameter concatenation utility by overloading methods, handling Chinese characters with java.net.URLEncoder, and providing reusable code for converting JSON or Map arguments into properly encoded query strings for HttpClient requests.
This guide shows how to create a custom HttpRequestRetryHandler that intelligently retries failed HTTP calls—handling timeouts, connection errors, SSL issues, and idempotent requests—and integrates it into a CloseableHttpClient built with a connection pool and custom request configuration.
This article explains how to update and use a Java HttpClient‑based spider that removes duplicate links, handles legacy page formats, extracts movie metadata and download URLs (magnet, ed2k, Baidu Pan), and stores the results in a MySQL database, with complete source code examples.
This article presents a Java HttpClient-based web crawler that extracts Chinese characters and their pinyin using regular expressions, stores the data in a MySQL database, and provides complete source code along with execution results and screenshots.
The article explains that a SocketClosed error in Apache HttpClient occurs when CloseableHttpResponse is closed before the response entity is fully consumed, and shows how moving the close() call after EntityUtils.consume resolves the issue, with before‑and‑after code examples.
This article explains how to detect HTTP 302 redirects when using HttpClient for API testing, extract the Location header, adjust request configurations to disable automatic redirects and ignore cookies, and provides Java code examples for processing the response and managing the client pool.
This article explains why releaseConnection() is deprecated in HttpClient 4.5, introduces the PoolingHttpClientConnectionManager, and provides detailed code examples and step‑by‑step guidance for safely extracting response content, closing responses, consuming entities, releasing connections, and shutting down the HttpClient.
This article investigates persistent CLOSE_WAIT sockets in a Tomcat‑Nginx architecture, identifies HttpClient’s connection‑manager as the root cause, and details the step‑by‑step analysis and configuration changes that finally eliminated the issue.
The article explains that using the deprecated request.releaseConnection() with Apache HttpClient 4.5.5 can cause a java.net.SocketException: socket closed during high‑frequency API testing, and recommends switching to PoolingHttpClientConnectionManager to manage connections safely.
When using HttpClient for API testing, a JSONObject omits fields with null values, causing version parameters to be missing; initializing version strings to empty strings resolves the issue and ensures proper request payloads.
This guide shows how to disable HttpClient's automatic cookie handling, manually extract and store Set‑Cookie headers, and bind cookies to individual user objects so that multi‑user, multi‑threaded API tests can simulate concurrent logins reliably.
The article presents a Java HttpClient testing framework that leverages reflection to dynamically invoke API methods, detailing optimized functions for running all test cases of an interface, single test cases, and the core execution logic that interacts with a MySQL database and records results.
This guide shows how to replace outdated GET calls with a POST request to the Turing Robot API using Java's HttpClient, explains recent changes to the service, and provides a full, ready‑to‑run code example for retrieving chatbot replies.
This guide shares practical steps to overcome TIME_WAIT port exhaustion on macOS and optimize Apache HttpClient settings for high‑concurrency load testing, including sysctl tweaks for maximum file descriptors, port range adjustments, connection‑pool parameters, timeout configurations, and a custom connection‑recycling thread, enabling over 20 k concurrent requests without bottlenecks.
This article provides a complete Java HttpClient implementation for sending push notifications through AlertOver’s API, including JSON payload construction, request execution, response handling, and highlights potential integration tips for production environments.
A new employee at an OTA company faced a mysterious outage where thousands of payment‑related messages piled up in the queue, the system auto‑recovered, and a detailed investigation revealed a stuck MySQL transaction caused by missing response timeout settings, leading to lock contention and message backlog.
This article analyzes a production Java service that repeatedly hit org.apache.http.conn.ConnectionPoolTimeoutException due to exhausted HttpClient connection pools, explains how CLOSE_WAIT sockets are created when responses are not closed, and provides step‑by‑step code fixes and Tomcat configuration tweaks to eliminate the problem.
An in‑depth experiment shows that using Apache HttpClient 3.x without proper connection management quickly exhausts Linux file descriptors, causing “too many open files” errors, and explains the underlying fd limits, the role of SimpleHttpConnectionManager, and provides correct usage patterns for both HttpClient 3.x and 4.x, including connection pooling and idle‑connection cleanup.
This article introduces Java 11's most useful enhancements—including the var keyword, new String utilities, collection factory methods, Stream API additions, InputStream.transferTo, and the revamped HttpClient—showing how each feature simplifies code and improves productivity for modern Java developers.