arextest / arex-agent-java

Lightweight Java agent for traffic capture and replay, enhancing testing and debugging.
https://doc.arextest.com/
Apache License 2.0
463 stars 97 forks source link

[NOSQL-mock-support] #219

Open martris opened 2 years ago

martris commented 2 years ago

Background:

In some cases, we use NOSQL DB like Hbase , mongo ,ES to store heterogeneous or large data. But mock read/white access in NOSQL DB like Hbase with no data corruption is not currently supported in Arex. Thus replaying requests in NOSQL access is sometimes inconvenient.

Demand:

IN Relational DB:

Arex provided powerful mock ability such as collecting the sql used to access the database, and the sql collected is used when comparing recorded and replayed requests.Thus avoiding data corruption.

IN NOSQL DB :

Nosql like Hbase is not commonly used. But can we mock responses in accessing Hbase (or any other NOSQL db access)? most of those responses are in the terms of interfaces , and in Json types.

HARD THING:

For white access, the hardest thing is about no data corruption. As is reminded in nomal DB part,this is solved in sql collecting way. IN NOSQL DB ,can we build a solution by collecting Objects ? such as the set code: config.set(HConstants.ZOOKEEPER_QUORUM, "192.168.187.201") config.set(HConstants.ZOOKEEPER_CLIENT_PORT, "2181") config.setInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, 30000) config.setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 30000) Json code: { "ZOOKEEPER_QUORUM": "192.168.187.201", "ZOOKEEPER_CLIENT_PORT":"2181", "HBASE_CLIENT_OPERATION_TIMEOUT":30000, "HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD":30000 }

Or simply skip the MOCK part , just compare the interface reponses?

mr3 commented 1 year ago

@martris Maybe you could try to support one of them, looking forward to your feedback!

YongwuHe commented 1 year ago

@martris Thank you for posting in the AREX community! The mongo has been supported in PR: https://github.com/arextest/arex-agent-java/pull/272.