I'm using the method below to create a Topic and Consumer and register my
MessageListener.  I'm worried that with a retroactive consumer I'm missing
messages between the .createConsumer() method and when the MessageListener
is actually registered with the MessageConsumer.  Shouldn't there be some
way to set the listener before firing up the consumer?

 

public void subscribe(String destName, MessageListener l) throws
JMSException {

        char c = destName.contains("?")?'&':'?';

        destName = destName + c + "consumer.retroactive=true";

        System.out.println("ActiveMqClient subscribe " + destName); 

        MessageConsumer mc = session.createConsumer(
session.createTopic(destName) );

        mc.setMessageListener(l);

    }

 

Thanks,

Andrew

 

 

Reply via email to