b0444f3ce8d217677067f27b3c126183bd9fc38d
[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.SessionConnectedEvent;
7
8 public class SessionConnectedListener implements ApplicationListener<SessionConnectedEvent> {
9         private static final Logger LOGGER = LoggerFactory.getLogger(SessionConnectedListener.class);
10
11         @Override
12         public void onApplicationEvent(SessionConnectedEvent event) {
13                 LOGGER.info("SessionConnectedEvent timestamp: " + event.getTimestamp());
14                 LOGGER.info("SessionConnectedEvent user: " + event.getUser());
15                 LOGGER.info("SessionConnectedEvent: " + event.toString());
16         }
17
18 }