Backend Development 14 min read

AREX: An Open‑Source Traffic Recording and Replay Platform for Enterprise‑Scale Testing

AREX is an open‑source traffic recording and replay platform created by Ctrip that enables comprehensive testing—from performance and regression to rapid issue fixing—by capturing real traffic across complex micro‑service environments, addressing challenges such as async context, non‑idempotent calls, authentication, time‑sensitivity, and cache consistency, and offering easy CI/CD integration and large‑scale deployment.

Cognitive Technology Team
Cognitive Technology Team
Cognitive Technology Team
AREX: An Open‑Source Traffic Recording and Replay Platform for Enterprise‑Scale Testing

AREX is an open‑source traffic recording and replay platform developed by Ctrip, originally incubated within the ticket business unit. It focuses on building core recording and replay capabilities, has been iterated in complex enterprise scenarios, and now serves over 4,000 applications within the group, improving delivery rates and reducing defect counts.

Traffic recording and replay are valuable for performance testing, regression testing, automated testing, and rapid online issue resolution, but adoption faces challenges such as difficult infrastructure setup, high upfront costs, and unclear deployment scenarios.

Existing open‑source solutions largely extend Jvm‑Sandbox‑Repeater, which has limited middleware support, incomplete JDK integration for async contexts, and lacks a full backend for data collection, storage, and comparison. AREX was built to overcome these limitations by supporting a wider range of middleware, providing a complete backend, and offering a one‑stop workflow from traffic capture to report generation.

Technical challenges and solutions:

Cross‑thread and asynchronous traffic capture is achieved via Trace propagation, using a recordId passed through thread pools and async frameworks (e.g., CompletableFuture, ThreadPoolExecutor, ForkJoinPool, Reactor, RxJava) to stitch together distributed operations.

Non‑idempotent interfaces are mocked during replay to avoid dirty data, with support for Spring, Dubbo, Redis, Mybatis and other frameworks.

Authentication failures caused by token expiration are handled by mocking security frameworks such as Spring Security, Apache Shiro, and JWT.

Time‑sensitive business logic (e.g., payment timeout) is stabilized by recording the original timestamp and mocking time‑related classes (Date, Calendar, LocalTime, Joda) during replay.

Local cache inconsistencies are resolved by supporting popular cache libraries (Guava Cache, Caffeine) and providing extensible adapters for custom caches.

Deployment challenges and solutions: AREX offers one‑click, non‑container, private‑cloud, and single‑machine deployment modes, with simple configuration to start traffic capture and replay. Sensitive data is protected through SPI‑loaded JARs that perform data desensitization, meeting corporate security and compliance requirements.

Best practices and CI/CD integration: First‑time integration involves adding the AREX Agent to the CI pipeline; the agent is loaded with -javaagent:/arex-agent.jar and version‑controlled for gray releases. After code submission, replay is automatically triggered, and results (case count, pass rate, failure rate) are reported to gate the release to production.

Achievements: Since its internal rollout, AREX has been adopted by more than 4,000 applications, improving delivery efficiency and reducing defects. The platform was open‑sourced in 2023 (https://github.com/arextest) and now has thousands of external users (e.g., Lexin, Hangzhou Vision, SF Express) leveraging it for smoke testing, regression, new‑feature validation, and fault analysis.

Conclusion: AREX enables rapid, low‑cost, high‑efficiency testing throughout the software development lifecycle, helping teams focus on feature development while the platform handles data capture, replay, and analysis. The project invites developers to join the community and contribute to its ongoing evolution.

Backendci/cdtestingtraffic replayOpen SourceJava agent
Cognitive Technology Team
Written by

Cognitive Technology Team

Cognitive Technology Team regularly delivers the latest IT news, original content, programming tutorials and experience sharing, with daily perks awaiting you.

0 followers
Reader feedback

How this landed with the community

login 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.