teragrep / cfe_31

0 stars 0 forks source link

Refactor Client usage so it's declared once instead of multiple times #27

Closed MoonBow-1 closed 1 month ago

MoonBow-1 commented 9 months ago

Description Currently the Client is created each time a request is sent, consuming resources and possibly disregarding the benefits of connection pooling.

TODO:

  1. [x] Refactor the Client so that it's declared in Main.java, and passed to proper classes
  2. [x] Get the endpoint URI from the CLI arguments and pass it to the Client instead of hard-coded one
  3. [ ] Refactor error response handling so that it accepts string instead of the preformed JSON format
MoonBow-1 commented 9 months ago

Refactor the Client so that it's declared in Main.java, and passed to proper classes Get the endpoint URI from the CLI arguments and pass it to the Client instead of hard-coded one

These have been done, will look into the behavior when packaged next

MoonBow-1 commented 9 months ago

Currently waiting for opportunity to test SSL cert behavior / requirement

MoonBow-1 commented 8 months ago

Usage in Main.java:

final Client client = new Client(line.getOptionValue("endpoint"), configuration.token);

...

for (final PromiseList promiseList : promiseLists) {
    promiseList.parse();
    promiseList.sendPromises(captureMetaMap, client);
}
...
MoonBow-1 commented 1 month ago

This issue is not relevant anymore, had a discussion about this with the architect last week