Skip to content

Support disabling messaging annotations processing#11039

Merged
artembilan merged 4 commits into
spring-projects:mainfrom
mjd507:gh-11024-option4
Jun 5, 2026
Merged

Support disabling messaging annotations processing#11039
artembilan merged 4 commits into
spring-projects:mainfrom
mjd507:gh-11024-option4

Conversation

@mjd507
Copy link
Copy Markdown
Contributor

@mjd507 mjd507 commented Jun 3, 2026

By adding spring.integration.annotations.enable=false into the environment property or application.properties.

When disabled, the following post processors are not registered in the application context:

  • MessagingAnnotationPostProcessor
  • MessagingAnnotationBeanPostProcessor

Copy link
Copy Markdown
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Please, don't touch GatewayProxyInstantiationPostProcessor and IntegrationComponentScanRegistrar.
They are for components scanning, for those which represents some entries on classpath.

Their purpose similar to the @ComponentScan in Spring Framework.

What we are trying to prevent here is annotations on methods in beans.
So, our goal would be similar to opting-in into something like @EnableMvc, but that does not mean that when we don't opt-in, the @ComponentScan should not work, too.

I agree that something like @EnableIntegrationMethodAnnotations would sound better for you to not look into the IntegrationComponentScanRegistrar, but I don't think we need to go such a fine-grain naming while we can just document this new property and future annotation properly.

Please, make a respective change and we will come back to you shortly for the further review.

Thanks

@mjd507 mjd507 force-pushed the gh-11024-option4 branch from ffd54fb to 5a74aac Compare June 4, 2026 00:13
By adding `spring.integration.annotations.enable=false` into the environment property or application.properties.

When disabled, the following post processors are not registered in the application context:

- `MessagingAnnotationPostProcessor`
- `MessagingAnnotationBeanPostProcessor`

Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
@mjd507 mjd507 force-pushed the gh-11024-option4 branch from 5a74aac to f15139a Compare June 4, 2026 00:27
Copy link
Copy Markdown
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Please, consider to mention this property in the respective annotations chapter and in the what’s new one, too.

thanks

@mjd507 mjd507 requested a review from artembilan June 4, 2026 02:55
Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
@mjd507 mjd507 force-pushed the gh-11024-option4 branch from 2848a78 to 9c02447 Compare June 4, 2026 06:40
Comment thread src/reference/antora/modules/ROOT/pages/configuration/annotations.adoc Outdated
Comment thread src/reference/antora/modules/ROOT/pages/configuration/annotations.adoc Outdated
Comment thread src/reference/antora/modules/ROOT/pages/whats-new.adoc Outdated
Copy link
Copy Markdown
Contributor Author

@mjd507 mjd507 left a comment

Choose a reason for hiding this comment

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

The scope is now much more precise and focused, thanks for the feedback.

Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
@mjd507 mjd507 force-pushed the gh-11024-option4 branch from 83c700b to 2a225a3 Compare June 5, 2026 00:58
@mjd507 mjd507 requested a review from artembilan June 5, 2026 01:12
Copy link
Copy Markdown
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

LGTM!
Will merge in the morning from laptop.

Thank you!

Comment thread src/reference/antora/modules/ROOT/pages/configuration/annotations.adoc Outdated
Signed-off-by: Artem Bilan <artem.bilan@broadcom.com>
@artembilan artembilan merged commit 83469aa into spring-projects:main Jun 5, 2026
3 checks passed
@mjd507 mjd507 deleted the gh-11024-option4 branch June 5, 2026 23:49
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.

2 participants