docusign / docusign-esign-java-client

The Official Docusign Java Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://javadoc.io/doc/com.docusign/docusign-esign-java/latest/index.html
MIT License
105 stars 96 forks source link

Sane ApiClient (concurrency/resource usage improvements) #205

Closed sabirove closed 2 years ago

sabirove commented 3 years ago

This PR aims to solve/provide a workaround for

  1. ApiClient concurrency issues (e.g: https://github.com/docusign/docusign-esign-java-client/issues/123)
  2. Inefficient resource utilization issues (e.g. new http Client and ObjectMapper allocated per each new client with no way to provide those from the outside, thus avoiding concurrency issues by creating new instance is not an option. On top of that new http Client is allocated per each method call (!!!) for certain methods, see ApiClient::buildHttpClient).

Note:

sabirove commented 3 years ago

@mmallis87 please take a look.

sabirove commented 3 years ago

Build fails with

SdkUnitTests.setUp:68->getLastTenEnvelopeIds:1825 Exception: rsaPrivateKey byte array is empty

because this statement in SkdUnitTests

private static final byte[] privateKeyBytes = Base64.decode(System.getenv("PRIVATE_KEY"));

yields empty byte array. Not sure this has something to do with PR changes, looks more like a CI/env config related issue.

https://app.travis-ci.com/github/docusign/docusign-esign-java-client/jobs/529199291