Favor PathPatternMessageMatcher when activated

Issue gh-16500
This commit is contained in:
Josh Cummings 2025-04-22 14:51:40 -06:00
parent bc9ae1eed6
commit a683a3a730
No known key found for this signature in database
GPG Key ID: 869B37A20E876129

View File

@ -31,6 +31,9 @@ final class MessageMatcherAuthorizationManagerConfiguration {
MessageMatcherDelegatingAuthorizationManager.Builder messageAuthorizationManagerBuilder( MessageMatcherDelegatingAuthorizationManager.Builder messageAuthorizationManagerBuilder(
ApplicationContext context) { ApplicationContext context) {
MessageMatcherFactory.setApplicationContext(context); MessageMatcherFactory.setApplicationContext(context);
if (MessageMatcherFactory.usesPathPatterns()) {
return MessageMatcherDelegatingAuthorizationManager.builder();
}
return MessageMatcherDelegatingAuthorizationManager.builder() return MessageMatcherDelegatingAuthorizationManager.builder()
.simpDestPathMatcher( .simpDestPathMatcher(
() -> (context.getBeanNamesForType(SimpAnnotationMethodMessageHandler.class).length > 0) () -> (context.getBeanNamesForType(SimpAnnotationMethodMessageHandler.class).length > 0)