Class WebMvcStompEndpointRegistry
java.lang.Object
org.springframework.web.socket.config.annotation.WebMvcStompEndpointRegistry
- All Implemented Interfaces:
StompEndpointRegistry
A registry for STOMP over WebSocket endpoints that maps the endpoints with a
HandlerMapping
for use in Spring MVC.- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Artem Bilan
-
Constructor Summary
ConstructorDescriptionWebMvcStompEndpointRegistry
(WebSocketHandler webSocketHandler, WebSocketTransportRegistration transportRegistration, TaskScheduler defaultSockJsTaskScheduler) -
Method Summary
Modifier and TypeMethodDescriptionaddEndpoint
(String... paths) Register a STOMP over WebSocket endpoint at the given mapping path.Return a handler mapping with the mapped ViewControllers.protected int
getOrder()
protected @Nullable UrlPathHelper
Deprecated, for removal: This API element is subject to removal in a future version.protected boolean
protected void
setApplicationContext
(ApplicationContext applicationContext) setErrorHandler
(StompSubProtocolErrorHandler errorHandler) Configure a handler for customizing or handling STOMP ERROR frames to clients.void
setOrder
(int order) Set the order for the resultingHandlerMapping
relative to other handler mappings configured in Spring MVC.setPreserveReceiveOrder
(boolean preserveReceiveOrder) Whether to handle client messages sequentially in the order in which they were received.void
setUrlPathHelper
(@Nullable UrlPathHelper urlPathHelper) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
WebMvcStompEndpointRegistry
public WebMvcStompEndpointRegistry(WebSocketHandler webSocketHandler, WebSocketTransportRegistration transportRegistration, TaskScheduler defaultSockJsTaskScheduler)
-
-
Method Details
-
addEndpoint
Description copied from interface:StompEndpointRegistry
Register a STOMP over WebSocket endpoint at the given mapping path.- Specified by:
addEndpoint
in interfaceStompEndpointRegistry
-
setOrder
public void setOrder(int order) Set the order for the resultingHandlerMapping
relative to other handler mappings configured in Spring MVC.The default value is 1.
- Specified by:
setOrder
in interfaceStompEndpointRegistry
-
getOrder
protected int getOrder() -
setUrlPathHelper
@Deprecated(since="7.0", forRemoval=true) public void setUrlPathHelper(@Nullable UrlPathHelper urlPathHelper) Deprecated, for removal: This API element is subject to removal in a future version.use ofPathMatcher
andUrlPathHelper
is deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser
.Set the UrlPathHelper to configure on theHandlerMapping
used to map handshake requests.- Specified by:
setUrlPathHelper
in interfaceStompEndpointRegistry
-
getUrlPathHelper
Deprecated, for removal: This API element is subject to removal in a future version. -
setErrorHandler
Description copied from interface:StompEndpointRegistry
Configure a handler for customizing or handling STOMP ERROR frames to clients.- Specified by:
setErrorHandler
in interfaceStompEndpointRegistry
- Parameters:
errorHandler
- the error handler
-
setPreserveReceiveOrder
Description copied from interface:StompEndpointRegistry
Whether to handle client messages sequentially in the order in which they were received.By default messages sent to the
"clientInboundChannel"
may be handled in parallel and not in the same order as they were received because the channel is backed by a ThreadPoolExecutor that in turn does not guarantee processing in order.When this flag is set to
true
messages within the same session will be sent to the"clientInboundChannel"
one at a time in order to preserve the order in which they were received.- Specified by:
setPreserveReceiveOrder
in interfaceStompEndpointRegistry
-
isPreserveReceiveOrder
protected boolean isPreserveReceiveOrder() -
setApplicationContext
-
getHandlerMapping
Return a handler mapping with the mapped ViewControllers.
-
PathMatcher
andUrlPathHelper
is deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser
.