spring-framework / org.springframework.messaging.simp.config / MessageBrokerRegistry / setPathMatcher

setPathMatcher

open fun setPathMatcher(pathMatcher: PathMatcher): MessageBrokerRegistry

Configure the PathMatcher to use to match the destinations of incoming messages to @MessageMapping and @SubscribeMapping methods.

By default org.springframework.util.AntPathMatcher is configured. However applications may provide an AntPathMatcher instance customized to use "." (commonly used in messaging) instead of "/" as path separator or provide a completely different PathMatcher implementation.

Note that the configured PathMatcher is only used for matching the portion of the destination after the configured prefix. For example given application destination prefix "/app" and destination "/app/price.stock.**", the message might be mapped to a controller with "price" and "stock.**" as its type and method-level mappings respectively.

When the simple broker is enabled, the PathMatcher configured here is also used to match message destinations when brokering messages.

Since
4.1

See Also
org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry#setPathMatcher