b6e3619c70a4fdc16f2545fb1c337740f2e0723d
[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.messaging.simp.broker.BrokerAvailabilityEvent;
7
8 public class BrokerAvailabilityListener implements ApplicationListener<BrokerAvailabilityEvent> {
9         private static final Logger LOGGER = LoggerFactory.getLogger(BrokerAvailabilityListener.class);
10
11         @Override
12         public void onApplicationEvent(BrokerAvailabilityEvent event) {
13                 
14                 LOGGER.info("BrokerAvailabilityEvent timestamp: " + event.getTimestamp());
15                 LOGGER.info("BrokerAvailabilityEvent brokerAvailable: " + event.isBrokerAvailable());
16                 LOGGER.info("BrokerAvailabilityEvent: " + event.toString());
17         }
18
19 }