Skip to content

Conversation

dmitrysulman
Copy link
Contributor

This PR adds support for beans annotated with @ControllerAdvice inRSocketMessagingAutoConfiguration, allowing the use of global @MessageExceptionHandler methods.

See spring-projects/spring-framework#26636 (comment)

Fixes #45360

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 20, 2025
@philwebb philwebb changed the title Add @ControllerAdvice support to RSocket messaging auto-configuration Add @ControllerAdvice support to RSocket messaging auto-configuration Sep 22, 2025
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 2, 2025
@wilkinsona wilkinsona added this to the 4.0.x milestone Oct 2, 2025
@snicoll snicoll self-assigned this Oct 6, 2025
@snicoll snicoll modified the milestones: 4.0.x, 4.0.0-RC1 Oct 6, 2025
@snicoll
Copy link
Member

snicoll commented Oct 6, 2025

Thanks for the PR! Closed by b10262c (I used the id of the linked issue).

@ControllerAdvice and ControllerAdviceBean are in spring-web unfortunately and spring-messaging cannot depend on that.

FTR neither can we, so my polish commit moves that to a separate customizer that only kicks in if spring-web is also on the classpath.

@snicoll snicoll closed this Oct 6, 2025
@dmitrysulman
Copy link
Contributor Author

dmitrysulman commented Oct 6, 2025

@snicoll thanks!

FTR neither can we

I just wanted to clarify. Currently spring-web is declared as an implementation dependency in the spring-boot-rsocket module (see its build.gradle), so it's always on the classpath. Should this actually be an optional dependency instead?

@snicoll
Copy link
Member

snicoll commented Oct 6, 2025

Currently spring-web is declared as an implementation dependency in the spring-boot-rsocket module

Good point I had missed that. I think that's worth exploring. See #47409 for further details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-Configure ControllerAdvice beans in RSocket support
4 participants