I just took a look at the code and it looks like the ActiveMQProducer.sendmethod is overwriting the CMSExpiration in the message with its timeToLive value. This is incorrect - it should set the expiry to (expiry + timeToLive). I've captured this in a JIRA issue: https://issues.apache.org/activemq/browse/AMQCPP-14
In the mean time, the CMS Expiration and TimeToLive serve basically the same purpose. I'm not sure exactly what results you're looking for, but you should be able to do essentially the same thing by using the TimeToLive value in the ActiveMQProducer. Regards, Nate On 11/26/06, sgliu <[EMAIL PROTECTED]> wrote:
I konw the function Message::setCMSExpiration(long).I think it is live time of message. But follow code,10 second later,I receive message yet. ... session = connection->createSession( Session::AUTO_ACKNOWLEDGE ); destination = session->createTopic( "mytopic" ); ... producer->setDeliveryMode( DeliveryMode::PERSISTANT ); ... string text = "Hello world!" TextMessage* message = session->createTextMessage( text ); message->setCMSExpiration(10000); producer->send( message ); delete message; Why? -- View this message in context: http://www.nabble.com/Message%27s-live-time-tf2706004.html#a7544897 Sent from the ActiveMQ - User mailing list archive at Nabble.com.