|
/** |
|
* Use this when you don't want to participate in global resources and |
|
* you want to customize the creation of the managed {@code ConnectionProvider}. |
|
* <p>By default, {@code ConnectionProvider.elastic("http")} is used. |
|
* <p>Note that this option is ignored if {@code userGlobalResources=false} or |
|
* {@link #setConnectionProvider(ConnectionProvider)} is set. |
|
* @param supplier the supplier to use |
|
*/ |
|
public void setConnectionProviderSupplier(Supplier<ConnectionProvider> supplier) { |
|
this.connectionProviderSupplier = supplier; |
I wonder whether useGlobalResources=false option ignores connectionProviderSupplieroption or not cause the code seems it's not
|
public void start() { |
|
synchronized (this.lifecycleMonitor) { |
|
if (!this.running) { |
|
if (this.useGlobalResources) { |
|
Assert.isTrue(this.loopResources == null && this.connectionProvider == null, |
|
"'useGlobalResources' is mutually exclusive with explicitly configured resources"); |
|
HttpResources httpResources = HttpResources.get(); |
|
if (this.globalResourcesConsumer != null) { |
|
this.globalResourcesConsumer.accept(httpResources); |
|
} |
|
this.connectionProvider = httpResources; |
|
this.loopResources = httpResources; |
|
} |
|
else { |
|
if (this.loopResources == null) { |
|
this.manageLoopResources = true; |
|
this.loopResources = this.loopResourcesSupplier.get(); |
|
} |
|
if (this.connectionProvider == null) { |
|
this.manageConnectionProvider = true; |
|
this.connectionProvider = this.connectionProviderSupplier.get(); |
|
} |
|
} |
|
this.running = true; |
|
} |
|
} |
|
|
|
} |
if i'm wrong enlighten me please
thank you in advance
spring-framework/spring-web/src/main/java/org/springframework/http/client/ReactorResourceFactory.java
Lines 121 to 130 in 313b063
I wonder whether
useGlobalResources=falseoption ignoresconnectionProviderSupplieroption or not cause the code seems it's notspring-framework/spring-web/src/main/java/org/springframework/http/client/ReactorResourceFactory.java
Lines 262 to 289 in 313b063
if i'm wrong enlighten me please
thank you in advance