jmulford-bw / Java-V2-Messaging-SDK

0 stars 1 forks source link

Don't use deprecated classes #19

Open n-miles opened 5 years ago

n-miles commented 5 years ago

The HTTP client the SDK is using is deprecated. BandwidthClient.getClient() returns a brand new, deprecated DefaultHttpClient every time you call it. Don't do that. We should instead be using an HttpClientBuilder to build a client.

Also, it should definitely not be returning a brand new client every time that method is called. There should only ever be one client around. Those things are heavy and consume a lot of resources.

fuchsnj commented 5 years ago

Using multiple clients also prevents things like proper connection pooling / keep-alive / etc.