90ee1da393064ef4a55a8e78bbd86545f6225807
[JavaForFun] /
1 package de.spring.stomp.listeners;
2
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.springframework.context.ApplicationListener;
6 import org.springframework.web.socket.messaging.SessionSubscribeEvent;
7
8 public class SessionSubscribeListener implements ApplicationListener<SessionSubscribeEvent> {
9         private static final Logger LOGGER = LoggerFactory.getLogger(SessionSubscribeListener.class);
10
11         @Override
12         public void onApplicationEvent(SessionSubscribeEvent event) {
13                 LOGGER.info("SessionSubscribeEvent timestamp: " + event.getTimestamp());
14                 LOGGER.info("SessionSubscribeEvent user: " + event.getUser());
15                 LOGGER.info("SessionSubscribeEvent: " + event.toString());
16         }
17
18 }