Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sane ApiClient (concurrency/resource usage improvements) #205

Closed
wants to merge 2 commits into from
Closed

Sane ApiClient (concurrency/resource usage improvements) #205

wants to merge 2 commits into from

Conversation

sabirove
Copy link

@sabirove sabirove commented Aug 4, 2021

This PR aims to solve/provide a workaround for

  1. ApiClient concurrency issues (e.g: Thread Safety - either fix or document #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:

  • Changes are not braking and backwards compatible
  • ApiClient API is intact. New API (ApiClientFactory) is added to address the issues
  • Java version bumped to 1.8 (README.MD specifies requirement as 1.9+ anyway)

- refactor http Client init into HttpClientFactory
- bump java to 1.8
@sabirove
Copy link
Author

sabirove commented Aug 4, 2021

@mmallis87 please take a look.

@sabirove
Copy link
Author

sabirove commented Aug 5, 2021

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

@sabirove sabirove closed this Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant