Externally managed mode for ReactorResourceFactory [SPR-17243] #21776
ReactorResourceFactory has setters for ConnectionProvider and LoopResources that need to be used to make customizations but that doesn't make it clear if those instances should be managed or not. We should probably also add Supplier-based variants for customizations and leave the setters for providing externally managed instances.
Affects: 5.1 RC2
Brian Clozel commented
This change broke the Spring Boot build, even though we're using a very simple arrangement.
The following code snippet breaks:
ReactorResourceFactory resources = new ReactorResourceFactory(); resources.afterPropertiesSet(); ReactorClientHttpConnector connector = new ReactorClientHttpConnector(resources, Function.identity());
With the exception
java.lang.IllegalArgumentException: ConnectionProvider not initialized yet via InitializingBean. at org.springframework.util.Assert.notNull(Assert.java:198) at org.springframework.http.client.reactive.ReactorResourceFactory.getConnectionProvider(ReactorResourceFactory.java:147) at org.springframework.http.client.reactive.ReactorClientHttpConnector.initHttpClient(ReactorClientHttpConnector.java:81) at org.springframework.http.client.reactive.ReactorClientHttpConnector.<init>(ReactorClientHttpConnector.java:77) at Scratch.main(scratch_1.java:17)
It seems that the