watson-developer-cloud / java-sdk

:1st_place_medal: Java SDK to use the IBM Watson services.
http://watson-developer-cloud.github.io/java-sdk/
Apache License 2.0
594 stars 532 forks source link

[speech-to-text] Recent commit removed ability to configure OkHttpClient for services #722

Closed DigitalZebra closed 7 years ago

DigitalZebra commented 7 years ago

Hello, We are currently using the ability to configure OkHttpClient in the method WatsonService.configureHttpClient to configure proxies and other settings needed before connecting to the speech to text service via the SDK. We noticed that this configuration API was removed with commit https://github.com/watson-developer-cloud/java-sdk/pull/690/commits/3e1c6b6e36c42ef132aea2e5dfadf1722305d941 to fix issue #686. Unfortunately this puts us in a bind as we won't be able to upgrade to the latest version of the SDK and take advantage of future bug fixes and features.

Is there another way recommended to configure settings like this? Or, is there some other way we could provide the same functionality with the new singleton implementation that was added? I'm thinking that some sort of OkHttpClient factory that could be injected in to WatsonService would satisfy the requirement of re-using the connections and also providing a way to override how the client is constructed.

Thanks much!

germanattanasio commented 7 years ago

My bad @DigitalZebra, I will work on this and get it fixed next week

DigitalZebra commented 7 years ago

Thank you so much! We really appreciate it. Let me know if I can assist in any way.

germanattanasio commented 7 years ago

If you can write a PR that will be awesome!