kraken-io / kraken-java

Official Kraken.io library for Java
https://kraken.io/
Apache License 2.0
9 stars 13 forks source link

Make timeouts configurable #24

Closed Canos closed 1 year ago

Canos commented 1 year ago

I appreciate your product, but when the image is big, your server or mine is slow. Timeouts are reached.

Current timeouts are hardcoding to 3 seconds, can you make it configurable?

I'm talking about DefaultIOKrakenClient class

private Client createClient(ObjectMapper objectMapper) {
        final ClientConfig clientConfig = new ClientConfig();
        clientConfig.property(ClientProperties.FOLLOW_REDIRECTS, true);
        clientConfig.property(ClientProperties.CONNECT_TIMEOUT, 3000);
        clientConfig.property(ClientProperties.READ_TIMEOUT, 3000);
        clientConfig.property(ClientProperties.FEATURE_AUTO_DISCOVERY_DISABLE, true);

        final JacksonJsonProvider jacksonJsonProvider = new JacksonJsonProvider(objectMapper);
        final Client client = ClientBuilder.newClient(clientConfig).register(jacksonJsonProvider).register(MultiPartFeature.class);
        final Feature feature = new LoggingFeature(JERSEY_LOGGER, Level.FINE, LoggingFeature.Verbosity.PAYLOAD_ANY, null);
        client.register(feature);
        return client;
    }
AntoineDuComptoirDesPharmacies commented 1 year ago

It seems that someone already code this in the master branch. See : https://github.com/kraken-io/kraken-java/pull/16

@danielsreichenbach Can we have a new version released on maven please ?

danielsreichenbach commented 1 year ago

It seems that someone already code this in the master branch. See : #16

@danielsreichenbach Can we have a new version released on maven please ?

That would have to be done by the Kraken folks. I am not associated with Kraken at all.

nekkra commented 1 year ago

@Canos @AntoineDuComptoirDesPharmacies Just FYI this release is now available on Sonatype/MVN (v1.1.2). Sorry for the wait.

Canos commented 1 year ago

Thank you very much