Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT-4513: Clean IntManageConf from removed beans #2530

Closed
wants to merge 1 commit into from

Conversation

artembilan
Copy link
Member

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

The IntegrationManagementConfigurer keeps metrics beans in its local
stores.
When we add beans at runtime, they are not removed from those caches
after their removal

  • Implement DestructionAwareBeanPostProcessor in the IntegrationManagementConfigurer
    and clean up caches according provided bean type and its name
  • Improve ManualFlowTests and FtpTests to be sure that
    IntegrationManagementConfigurer caches are cleared after destroying
    IntegrationFlowRegistration

Cherry-pick to 5.0.x

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

The `IntegrationManagementConfigurer` keeps metrics beans in its local
stores.
When we add beans at runtime, they are not removed from those caches
after their removal

* Implement `DestructionAwareBeanPostProcessor` in the `IntegrationManagementConfigurer`
and clean up caches according provided bean type and its name
* Improve `ManualFlowTests` and `FtpTests` to be sure that
`IntegrationManagementConfigurer` caches are cleared after destroying
 `IntegrationFlowRegistration`

**Cherry-pick to 5.0.x**
Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's all (and travis checkstyle).

@@ -246,7 +247,8 @@ public void afterSingletonsInstantiated() {
this.metricsFactory = new DefaultMetricsFactory();
}
this.sourceConfigurers.putAll(this.applicationContext.getBeansOfType(MessageSourceMetricsConfigurer.class));
Map<String, IntegrationManagement> managed = this.applicationContext.getBeansOfType(IntegrationManagement.class);
Map<String, IntegrationManagement> managed = this.applicationContext
.getBeansOfType(IntegrationManagement.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we suppress eager init here too? (and other gBOT calls in this class).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I believe it isn't going to harm, but at the same time it is idempotent here: all getBeansOfType() is called only from the afterSingletonsInstantiated() which is done only once.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok; I'll fix the checkstyle during merge.

@artembilan
Copy link
Member Author

Merged as adbbca1 and cherry-picked to 5.0.x including subsequent polishing like: 169eb74

@artembilan artembilan closed this Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants