Fix SourcePollingChAdFB autoStartup propagation

The `spring.integration.properties` can come with the `noAutoStartup`
property where we can specify a source polling channel adapter endpoint to
not start automatically.
Turns out the `SourcePollingChannelAdapterFactoryBean` propagates its
`autoStartup` property unconditionally which will skip the `noAutoStartup` value
because an `AbstractEndpoint.setAutoStartup()` sets an `autoStartupSetExplicitly` state

* Fix `SourcePollingChannelAdapterFactoryBean` to rely on a `Boolean` object state
and don't call target endpoint `setAutoStartup()` if it was not set
* Adjust `spring.integration.properties` in tests to use `noAutoStartup`
for some `SourcePollingChannelAdapterFactoryBean`
* Verify that property was applied in the `IntegrationFlowTests.testWithSupplierMessageSourceImpliedPoller()`

**Cherry-pick to `5.4.x` & `5.3.x`**
This commit is contained in:
Artem Bilan
2021-07-06 14:18:02 -04:00
committed by Gary Russell
parent db4f120dac
commit a5776524e2
3 changed files with 16 additions and 7 deletions

View File

@@ -3,4 +3,4 @@
#spring.integration.channels.maxBroadcastSubscribers=1
spring.integration.taskScheduler.poolSize=20
spring.integration.messagingTemplate.throwExceptionOnLateReply=true
spring.integration.endpoints.noAutoStartup=fooService*
spring.integration.endpoints.noAutoStartup=fooService*,stringSupplierEndpoint