paymill / paymill-java

Java wrapper for Paymill API
http://paymill.github.io
MIT License
26 stars 22 forks source link

Cannot override the default connection timeout #45

Closed 0xabadea closed 10 years ago

0xabadea commented 10 years ago

This is a continuation of issue #40.

There still does not seem to be a way to override the timeout of the HTTP connections. It is set to the default (zero) which the Javadoc of URLConnection promises to be "infinity". I see no way in which this is reasonable. The default timeout should be a reasonably small value such as a minute, and there should be a way to override it.

stoilkov commented 10 years ago

You can declare a timeout with the constructor public PaymillContext( final String apiKey, Integer timeout ). Have you tried that?

0xabadea commented 10 years ago

Aaah. Sorry -- I hadn't noticed there was a new version of the library. My comment referred to version 2. I'll give v3 a look.

stoilkov commented 10 years ago

There are some changes in v3 but i highly recommend you to update, as we cannot support v2 any longer. There is no way to configure the timeout in v2, unless of course you do it yourself. The correct place for this is the createConnection method in the HttpClient class.