Commit 5c2c4fee authored by Georg Mittendorfer's avatar Georg Mittendorfer

Reactivate connection pooling. Premature close exceptions tracked down and...

Reactivate connection pooling. Premature close exceptions tracked down and fixed (corrected network timeouts).
parent 7f03d322
......@@ -19,28 +19,24 @@
package com.mio.piri;
import com.mio.piri.commands.IriCommand;
import com.mio.piri.service.CommandChecker;
import com.mio.piri.metrics.CommandStatistics;
import com.mio.piri.metrics.MeterFactory;
import com.mio.piri.nodes.*;
import com.mio.piri.nodes.selection.*;
import com.mio.piri.service.CommandChecker;
import com.mio.piri.service.validation.*;
import com.mio.piri.tolerance.CircuitBreakerFactory;
import com.mio.piri.tolerance.RateLimiterRegistry;
import com.mio.piri.util.ClientSessionExtractor;
import com.mio.piri.service.validation.*;
import com.mio.piri.util.UrlValidator;
import io.micrometer.core.instrument.MeterRegistry;
import org.slf4j.LoggerFactory;
import org.springframework.boot.convert.DurationStyle;
import org.springframework.boot.web.reactive.function.client.WebClientCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.core.env.Environment;
import org.springframework.http.client.reactive.ReactorResourceFactory;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.netty.http.HttpResources;
import reactor.netty.resources.ConnectionProvider;
import java.time.Duration;
......@@ -62,17 +58,17 @@ public class PiriConfiguration {
return new MeterFactory(registry);
}
@Bean
public ReactorResourceFactory reactorResourceFactory() {
// @Bean
// public ReactorResourceFactory reactorResourceFactory() {
// ConnectionProvider connectionProvider = ConnectionProvider.fixed("piri-fixed");
// ConnectionProvider connectionProvider = ConnectionProvider.elastic("piri-elastic");
ConnectionProvider connectionProvider = ConnectionProvider.newConnection();
LoggerFactory.getLogger(getClass()).info("Set http connection provider: [{}}", connectionProvider);
HttpResources.set(connectionProvider);
// ConnectionProvider connectionProvider = ConnectionProvider.newConnection();
// LoggerFactory.getLogger(getClass()).info("Set http connection provider: [{}}", connectionProvider);
// HttpResources.set(connectionProvider);
// not working with global resource sharing:
// resourceFactory.setConnectionProviderSupplier(() -> ConnectionProvider.fixed("piri-webflux"));
return new ReactorResourceFactory();
}
// return new ReactorResourceFactory();
// }
@Bean
public CircuitBreakerFactory circuitBreakerFactory(MeterFactory meterFactory, Environment env) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment