Java Code Examples for org.springframework.http.client.reactive.ReactorResourceFactory

Following code examples demonstrate how to use org.springframework.http.client.reactive.ReactorResourceFactoryfrom spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.http.client.reactive.ReactorResourceFactoryand various code implementation of this class.

    public WebClient webClient(WebClient.Builder builder, ReactorResourceFactory factory) {
        factory.setConnectionProvider(ConnectionProvider.newConnection());
        return builder
                .clientConnector(new ReactorClientHttpConnector(factory, HttpClient::secure))
                .baseUrl(rootUri)
                .build();
    } 


		public ReactorResourceFactory reactorResourceFactory() {
			ReactorResourceFactory factory = new ReactorResourceFactory();
			factory.setGlobalResources(false);
			return factory;
		} 

Advertisement
Javadoc
Factory to manage Reactor Netty resources, i.e. LoopResources for event loop threads, and Connection

Provider for the connection pool, within the lifecycle of a Spring ApplicationContext.

This factory implements InitializingBean and DisposableBean and is expected typically to be declared as a Spring-managed bean. @author Rossen Stoyanchev @since 5.1

Read More
Advertisement