activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew M" <and...@oc384.net>
Subject setting a MessageListener on a consumer?
Date Mon, 24 Mar 2008 18:56:30 GMT
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

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message