您可以
SessionUnsubscribeEvent像这样收听事件:
@Controllerpublic class SessionUnsubscribeListener implements ApplicationListener<SessionUnsubscribeEvent> { @Override public void onApplicationEvent(SessionUnsubscribeEvent event) { GenericMessage message = (GenericMessage) event.getMessage(); String simpDestination = (String) message.getHeaders().get("simpDestination"); if ("/topic/service".equals(simpDestination)) {// do stuff } }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)