arex-agent-java icon indicating copy to clipboard operation
arex-agent-java copied to clipboard

[NOSQL-mock-support]

Open martris opened this issue 3 years ago • 2 comments

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:

  • Capable in MOCK NOSQL DB access.
  • Record NOSQL DB connection, setting Objects.
  • No data corruption

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?

martris avatar Nov 02 '22 09:11 martris

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

mr3 avatar Jul 21 '23 02:07 mr3

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

YongwuHe avatar Sep 05 '23 02:09 YongwuHe