arex-agent-java is a free, open source api development & testing project written in Java and released under Apache-2.0. It has 572 GitHub stars, 143 forks and 74 open issues, and was last pushed 2 months ago. On this registry it ranks #175 of 186 tracked projects in API Development & Testing, with 5 head-to-head comparisons available. It gained 3 stars over the last 30 tracked days.

What is arex-agent-java?

arex-agent-java is an Apache-2.0 licensed Java agent that attaches to any Java 8+ application through the JVM javaagent flag, weaves bytecode into existing code to record real live traffic, and replays that recorded data for mocking, testing and debugging, built for QA, test-automation and DevOps teams that maintain evolving Java services.

What it is

arex-agent-java is the agent component of AREX, described in its README as an open source testing framework built on real world data. The framework follows a deliberately plain principle: it uses the data an application already produces in production — database records, service payloads, cache items and similar — as the input for regression testing. The agent is shipped as an out-of-box agent file that can be attached to any application running Java 8 or above, and it dynamically weaves bytecode into existing code to record the real data of live traffic, which is then reused and replayed for mocking, testing and debugging purposes.

The concrete problem it solves is the cost of testing a system that keeps growing in complexity. As an application evolves, the effort required to test it thoroughly becomes tremendous, and hand-built fixtures and mock data fall out of step with production behaviour. AREX records from live traffic rather than from a proxy: the README states that instead of being a proxy like other similar frameworks, AREX sits in the background without awareness of the application and captures realistic data in live traffic, which means no intrusive code changes are required when integrating it into an existing Java application. It relies on the Java Instrument API and instruments a broad set of widely used libraries and frameworks.

Key capabilities

  • Attaches as a JVM javaagent, so instrumentation is enabled without code changes to the target application.
  • Uses the Java Instrument API to weave bytecode into running applications on Java 8 through 21.
  • Records live traffic data including database records, service payloads and cache items for later replay.
  • Replays recorded traffic for mocking, testing and debugging of new builds.
  • Covers HTTP clients: Apache HttpClient 4.0+, OkHttp 3.0 to 4.11, Feign 9.0+, Spring OpenFeign, Spring RestTemplate, Spring WebClient 5.0+, ning/async-http-client and Elasticsearch Client 7.x+.
  • Covers cache and Redis clients: Caffeine Cache, Guava Cache, Spring Cache, RedisTemplate, Jedis 2.10+ and 4+, Redisson 3.0+ and Lettuce 5.x and 6.x.
  • Covers persistence and RPC: MyBatis 3.x, MyBatis-Plus, TkMyBatis, Hibernate 5.x, MongoDB 3.x and 4.x, Apache Dubbo 2.x and 3.x and Alibaba Dubbo 2.x.
  • Supports Spring Boot 1.4+ and 2.x+, Servlet API 3+ and 5+, Spring Security 5.x, Apache Shiro 1.x, JCasbin 1.x, Auth0 jwt 3.x, jjwt 0.1+, Netty HTTP server 3.x and 4.x and Apollo Config 1.x and 2.x.

Who uses it and how

  • QA and regression-testing teams that need repeatable test data for Java services without writing fixtures by hand.
  • Development teams maintaining microservices built on Spring Boot, Dubbo or Spring Cloud HTTP and RPC stacks, where recorded payloads flow across service boundaries.
  • DevOps and platform teams that attach the agent at deployment time through the javaagent JVM flag, keeping application artefacts unchanged.
  • Applications running on Java 8 through 21, since the agent's supported JDK range matches the build range.
  • Local debugging workflows, where the agent is run with its CLI in local mode instead of against a shared storage service.

Getting started

Download the latest binary from the project releases page, or build it with mvn clean install -DskipTests, which places arex-agent.jar in the arex-agent-jar folder. Run the application with java -javaagent:/path/to/arex-agent.jar -Darex.service.name=my-service-name -Darex.storage.service.host= -jar my-application.jar, or put the same settings such as arex.service.name and arex.storage.service.host in an arex.agent.conf file and pass it with -Darex.config.path.

How it compares

The facts provided name no paid products that this project replaces, and no competing tools by name; the README refers only generically to other similar frameworks that act as proxies. On that basis the project stands alone in this registry rather than in a documented replacement set. A comparison against named alternatives cannot be made from the material available.

When to use it — and when not to

A self-hoster must also run the separate AREX storage service, since the agent works alongside it and is configured with its host and port. Teams outside the JVM ecosystem should not pick it, as instrumentation support is entirely Java and library-specific, and the README's own support list is still marked as being added to, so coverage of a given framework version should be checked before adoption. Adopting the agent also means accepting an agent that instruments bytecode inside production applications, which is a heavier trust decision than attaching a read-only log shipper.

project readme (upstream, from github) — read inline

Build Status Coverage Quality Gate Status

Arex Icon AREX

An Open Source Testing Framework with Real World Data

Introduction

As your application evolves more complex, the effort required to thoroughly test against it also becomes tremendous. Arex is a framework designed around a quite straightforward principle of leveraging your real world data(i.e. database record, service payload, cache items etc.) for regression testing. Simple is powerful. The idea behind makes it incredibly powerful.

AREX provides an out-of-box agent file that could be attached to any applications with Java 8+ and dynamically weaves solid bytecode into your existing code to record the real data of live traffic, and further use and replay it for mocking, testing, and debugging purpose.

AREX is implemented with an unique mechanism for recording. Instead of being a proxy like other similar framework, AREX sits in the background without awareness of your application to record realistic data in live traffic which means that no intrusive code changes are required when integrating it to your existing application.

AREX utilizes the advanced Java technique, Instrument API, and is capable of instrumenting various libraries and frameworks which are widely used.

Libraries and frameworks supported by Arex (to be added...) maven version range rules

Foundation
  • Java Executors
  • System time
  • Dynamic Type
Cache Library
  • Caffeine Cache
  • Guava Cache
  • Spring Cache
Spring
  • Spring Boot [1.4+, 2.x+]
  • Servlet API 3+、5+
Http Client
  • Apache HttpClient [4.0,)
  • OkHttp [3.0, 4.11]
  • Feign [9.0,)
  • Spring OpenFeign
  • Spring RestTemplate
  • Spring WebClient [5.0,)
  • ning/async-http-client
  • Elasticsearch Client [7.x,)
Redis Client
  • RedisTemplate
  • Jedis [2.10+, 4+]
  • Redisson [3.0,)
  • Lettuce [5.x, 6.x]
Persistence framework
  • MyBatis 3.x, MyBatis-Plus, TkMyBatis
  • Hibernate 5.x
NoSQL
  • MongoDB [3.x, 4.x]
RPC
  • Apache Dubbo [2.x, 3.x]
  • Alibaba Dubbo 2.x
Auth
  • Spring Security 5.x
  • Apache Shiro 1.x
  • JCasbin 1.x
  • Auth0 jwt 3.x
  • JWTK jjwt 0.1+、jjwt-api 0.10+
Netty
  • Netty http server [3.x, 4.x]
Config
  • Apollo Config [1.x, 2.x]

Building

Simply download the latest binary from releases or build the artifacts with the following commands. The build process supports JDK 8 - 21.

mvn clean install -DskipTests

The arex-agent.jar is in the folder arex-agent-jar/ after the build process.

If you wanna jar with version, build the artifacts with the following commands.

mvn clean install -DskipTests -Pjar-with-version

Getting Started

Enable the instrumentation agent by configuring a javaagent flag to the JVM to run arex:

AREX agent works along with the AREX storage service.

You could just configure the host and port of them respectively, like below

java -javaagent:/path/to/arex-agent.jar -Darex.service.name=my-service-name -Darex.storage.service.host=<storage.service.host:port> -jar my-application.jar

Alternatively, you can put those configuration item in arex.agent.conf file, like below

arex.service.name=my-service-name
arex.storage.service.host=<storage.service.host:port> 

Then simply run:

java -javaagent:/path/to/arex-agent.jar -Darex.config.path=/path/to/arex.agent.conf -jar my-application.jar

Also, You can Run with CLI in local mode:

Please refer to : AREX standalone mode.

Contributing

  1. Fork it
  2. Create your feature branch
  3. Commit your code changes and push to your feature branch
  4. Create a new Pull Request

License

Frequently asked questions

Is arex-agent-java free to use?

arex-agent-java is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does arex-agent-java do?

Lightweight Java agent for traffic capture and replay, enhancing testing and debugging.

What is arex-agent-java written in?

arex-agent-java is primarily written in Java. Its source is publicly available at https://github.com/arextest/arex-agent-java, and it has 572 GitHub stars.