I am planning a "consumer aware" service that will handle some type of information only if there is at least one consumer on that topic. Using spring, I was able to create the following code to monitor when consumers connect or disconnect from a topic:
@JmsListener(destination = "ActiveMQ.Advisory.Consumer.>")
public void processaConsumidorConectado(Message message){
System.out.println("Registrou um consumidor");
}
That works pretty well if the event occurs after I register to that topic. But it could happen that I already have a consumer in a topic before I registered this listener.
Is there a way to force activeMQ to send all advisory messages of a topic or something like that?