Configure JMS Messages Notifications
30.5.3. JMS Messages Notifications HornetQ's notifications can also be received using JMS messages. It is similar to receiving notifications using Core API but an important difference is that JMS requires a JMS Destination to receive the messages (preferably a Topic). To use a JMS Destination to receive management notifications, you must change the server's management notification address to start with jms.queue if it is a JMS Queue or jms.topic if it is a JMS Topic: jms.topic.notificationsTopic Once the notification topic is created, you can receive messages from it or set a MessageListener: Topic notificationsTopic = HornetQJMSClient.createTopic("notificationsTopic"); Session session = ... MessageConsumer notificationConsumer = session.createConsumer(notificationsTopic); notificationConsumer.setMessageListener(new MessageListener() { public void onMessage(Message notif) { System.out.println("------------------------"); System.out.println("Received notification:"); try { Enumeration propertyNames = notif.getPropertyNames(); while (propertyNames.hasMoreElements()) { String propertyName = (String)propertyNames.nextElement(); System.out.format(" %s: %s\n", propertyName, notif.getObjectProperty(propertyName)); } } catch (JMSException e) { } System.out.println("------------------------"); } });