Design and Implementation of a Traffic Recording and Replay Platform at Dewu

Dewu built a traffic recording and replay platform that captures fine‑grained, interface‑level Java traffic, stores it in Elasticsearch, and replays it via a Spring Boot‑controlled sandbox, enabling low‑cost, high‑fidelity regression testing, automated case classification, and early bug detection across multiple domains.

DeWu Technology
DeWu Technology
DeWu Technology
Design and Implementation of a Traffic Recording and Replay Platform at Dewu

The Dewu traffic recording and replay platform was built over several months to support daily development regression across multiple domains, accumulating over 1,000 automated regression cases and uncovering hidden bugs before release.

Background : Traditional automated regression suffers from high authoring and maintenance costs, leading teams to reduce scenario coverage. Recording real traffic for replay offers low‑cost case creation and high fidelity, enabling full‑iteration regression.

Product Design : After reviewing industry solutions, Dewu identified common pitfalls such as indiscriminate bulk recording and premature focus on link‑level replay. The design emphasizes fine‑grained, interface‑level case collection, single‑application process replay, and automated error classification.

Technical Selection : Two categories of tools exist – network‑level recorders (e.g., go‑replay) and in‑process recorders (e.g., Alibaba’s JVM Sandbox Repeater). The latter better supports regression testing for Dewu’s Java‑centric backend, so it was chosen as the foundation.

Architecture : The platform consists of a Spring Boot control plane, ES storage for recorded traffic, OSS‑distributed sandbox/repeater modules, and a dedicated container environment for replay to align configuration between recording and replay phases.

Technical Challenges & Solutions :

Bug fixes in the open‑source repeater (imbalanced sampling rate, JavaEntrancePlugin config‑change bug). Example fix:

@Override
public void onConfigChange(RepeaterConfig config) throws PluginLifeCycleException {
    if (configTemporary == null) {
        super.onConfigChange(config);
    } else {
        this.config = config;
        super.onConfigChange(config);
        List<Behavior> current = config.getJavaEntranceBehaviors();
        List<Behavior> latest = configTemporary.getJavaEntranceBehaviors();
        if (JavaPluginUtils.hasDifference(current, latest)) {
            reWatch0();
        }
    }
}

Extended plugin capabilities to support missing entry types (MQ, Dubbo, HTTP sub‑calls).

Implemented per‑interface independent sampling rates to handle low‑frequency services.

Introduced traffic tagging for scenario classification, enabling filtered case selection.

Developed automatic case sinking: when a flow matches a tag, it is auto‑added to a designated case set.

Enhanced replay failure diagnostics by categorizing failures and enriching reported data.

Addressed async‑thread replay issues by customizing ForkJoinTask instrumentation and offering configurable ignore‑sub‑call policies.

Explored read‑only interface replay in pre‑release/gray environments without mocking, balancing risk of unintended writes.

Conclusion : The platform demonstrates that traffic recording and replay can significantly improve regression efficiency, uncover hidden defects, and add value to the development lifecycle. Ongoing work focuses on further automation, richer analytics, and expanding support for complex scenarios.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend EngineeringAutomated TestingSoftware Testingjvm-sandbox
DeWu Technology
Written by

DeWu Technology

A platform for sharing and discussing tech knowledge, guiding you toward the cloud of technology.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.