INT-4485: Don't register bean twice for DSL Specs

JIRA: https://jira.spring.io/browse/INT-4485

The `IntegrationFlowBeanPostProcessor` performs extra bean registration
for the `IntegrationComponentSpec.get()` result.
Essentially it is going to be the same object in the end, but during
bean registration phase we end up with names conflict.

* Remove an explicit `registerComponent()` for the
`IntegrationComponentSpec.get()`
* Modify `CorrelationHandlerTests` for all possible usage for the
`MessageChannelSpec`, which is essentially a `FactoryBean`

**Cherry-pick to 5.0.x**
This commit is contained in:
Artem Bilan
2018-06-11 17:02:51 -04:00
committed by Gary Russell
parent 85bc183849
commit da53ed6838
2 changed files with 20 additions and 5 deletions

View File

@@ -309,7 +309,6 @@ public class IntegrationFlowBeanPostProcessor
}
private void processIntegrationComponentSpec(IntegrationComponentSpec<?, ?> bean) {
registerComponent(bean.get(), generateBeanName(bean.get(), bean.getId()));
if (bean instanceof ComponentsRegistration) {
Map<Object, String> componentsToRegister = ((ComponentsRegistration) bean).getComponentsToRegister();
if (!CollectionUtils.isEmpty(componentsToRegister)) {