Spring websocket Override DefaultUserDestinationResolver

橙三吉。 提交于 2020-01-04 06:38:29

问题


I want to override DefaultUserDestinationResolver so i can implement my custom queue user destination for example

/user/queue/call currently it is changed into /queue/call-user{session-id} , while in my case i want it to be changed into /queue/call-{userid}

The reason for this is that i want to be able to send a message to a user that is not subscribed yet and when he subscribe he can receive the message .

How can i ask spring to use my implementation of UserDestinationResolver


回答1:


Try to implement WebSocketMessageBrokerConfigurationSupport for some of your @Configuration and override:

@Bean
public UserDestinationResolver userDestinationResolver() { 
...
}

for your purpose.



来源:https://stackoverflow.com/questions/36068143/spring-websocket-override-defaultuserdestinationresolver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!