You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH-10309: Don't register bean for internal GatewayMH.gatewayProxyFactoryBean (#10311)
Fixes: #10309
The call of the `BeanFactory.initializeBean()` on the internal `GatewayProxyFactoryBean`
instance of the `GatewayMessageHandler` causes an extra bean to be processed everywhere.
Since such a registration happens from the `GatewayMessageHandler.start()`,
the `SpringIntegrationTestExecutionListener#prepareTestInstance` may suffer from a `ConcurrentModificationException`
on the `autoStartupCandidates`.
Just because its logic is to call `start()` from that `autoStartupCandidates` collection iteration.
Essentially, we don't need that since a `GatewayMessageHandler` is a bean itself.
The `GatewayProxyFactoryBean` is used internally to avoid logic duplication of the proxy
creating on the provided interface.
* Rework the logic of the `GatewayMessageHandler` to call all the respective `BeanFactory`
call-backs manually.
* Add an `IntegrationFlow` bean with a `gateway()` into the `MockMessageHandlerTests`
to ensure that `SpringIntegrationTestExecutionListener` does not suffer from a `ConcurrentModificationException`
anymore.
**Auto-cherry-pick to `6.5.x`**
Copy file name to clipboardExpand all lines: spring-integration-test/src/test/java/org/springframework/integration/test/mock/MockMessageHandlerTests.java
0 commit comments