Coder Social home page Coder Social logo

zekilu / arex-replay-schedule Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arextest/arex-replay-schedule

0.0 0.0 0.0 16.72 MB

Automates retrieval and sending of recorded data for targeted application testing and verification.

Java 99.91% Dockerfile 0.09%

arex-replay-schedule's Introduction

Arex Icon AREX Schedule Service

Introduction

Once you have successfully installed the AREX's Agent and configured it to use the Storage Service, you can initiate a replay to verify the impact of new version deployments on your target host. This process helps in understanding whether the changes are as expected or not.

How to Run a Replay

The replay process involves the following steps:

  1. Retrieve Records: Load all records from the Remote Storage Service for each API operation, categorizing them by version.

  2. Prepare and Send Requests: Organize the request messages and dispatch them to the target host.

  3. Collect Responses: Upon successful request transmission, gather all response results (including entry and dependent services) using recordId + replayId.

  4. Result Comparison: Compare these results as per configurations, categorized by MockCategoryType (e.g., HTTP servlet, Redis, DB).

  5. Report Generation: Send the replay comparison results to the API Service for analysis and summary creation.

Important Notes

  • Host Availability: Do not create a plan if the target host is unreachable.
  • Error Handling: Interrupt the plan if more than 10% of request sending results in exceptions.

Getting Started

1. Configuring Connection Strings

To set up the connection, modify the default localhost values in resources/META-INF/application.properties. Here's how you can configure for Redis, MySQL, and dependent web services:

# Web API
arex.storage.service.api=http://10.3.2.42:8093/api/storage/replay/query
arex.api.service.api=http://10.3.2.42:8090/api/report
arex.config.service.api=http://10.3.2.42:8091/api/config

# MySQL
spring.datasource.url=jdbc:mysql://10.3.2.42:3306/arexdb?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username=arex_admin
spring.datasource.password=arex_admin_password

# Redis
arex.redis.uri=redis://10.3.2.42:6379/

2. Extending the Replay Sender

The DefaultHttpReplaySender handles HTTP requests (PUT, GET, POST, DELETE, etc.). To implement a custom sender, follow the ReplaySender interface pattern:

public interface ReplaySender {
    /**
     * Indicate the instance should be working for the message content type,
     * return true should be used,others skipped
     */
    boolean isSupported(int contentType);

    /**
     * Try to send the replay case to remote target host
     */
    boolean send(ReplayActionCaseItem caseItem);

    /**
     * Try to send the request message to remote target host
     */
    ReplaySendResult send(SenderParameters senderParameters);

    /**
     * Try to prepare the replay case remote dependency such as resume config files
     */
    boolean prepareRemoteDependency(ReplayActionCaseItem caseItem);

    /**
     * Try to warm up the remote target service before sending
     */
    default boolean activeRemoteService(ReplayActionCaseItem caseItem) {
        return true;
    }
}

3. Extending Deployment Environments

To generate comprehensive reports, additional information such as the target image version and source code author is required. Implement the DeploymentEnvironmentProvider interface to provide this data:

public interface DeploymentEnvironmentProvider {
   
   DeploymentVersion getVersion(String appId, String env);
   
   List<ServiceInstance> getActiveInstanceList(AppServiceDescriptor serviceDescriptor, String env);
}

License

arex-replay-schedule's People

Contributors

qizhengmo avatar wildeslam avatar coryhh avatar binyu1005 avatar pangdayuan1 avatar sljoyy avatar mokdeve avatar yanwuqiu avatar wangyechao avatar lijing-22 avatar mentosl avatar yongwuhe avatar zhitaogan avatar mr3 avatar shanliang92 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.