1 package de.spring.stomp.listeners;
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.springframework.context.ApplicationListener;
6 import org.springframework.messaging.simp.broker.BrokerAvailabilityEvent;
8 public class BrokerAvailabilityListener implements ApplicationListener<BrokerAvailabilityEvent> {
9 private static final Logger LOGGER = LoggerFactory.getLogger(BrokerAvailabilityListener.class);
12 public void onApplicationEvent(BrokerAvailabilityEvent event) {
14 LOGGER.info("BrokerAvailabilityEvent timestamp: " + event.getTimestamp());
15 LOGGER.info("BrokerAvailabilityEvent brokerAvailable: " + event.isBrokerAvailable());
16 LOGGER.info("BrokerAvailabilityEvent: " + event.toString());