activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: TTL set to 30 seconds, but messages are not getting expired.
Date Wed, 19 Aug 2009 12:03:42 GMT
On Wed, 2009-08-19 at 04:00 -0700, psharma8@sapient.com wrote:
> I tried to test for TTL. But it is not working fine.
> I check messages @ "http://localhost:8161/admin". Messages are not getting
> expired after specified time.
> 
>         public void SendMessage(IBusMessage busMessage)
>         {
>             if (!this.isDisposed)
>             {
>                 IBytesMessage bytesMessage =
> this.session.CreateBytesMessage();
>                 byte[] byteArray =
> HelperUtils.GetByteArrayWithObject(busMessage.GetSerializableMessage());
>                 bytesMessage.Content = byteArray;
>              bytesMessage.NMSTimeToLive = new TimeSpan(0, 0, 30);
>              bytesMessage.NMSPersistent = true;
>                 this.producer.Send(bytesMessage);
>             }
> 	  }
> 
> Please let me know if there is any other changes to be made.

TTL values can only be specified when sending the message via the
producers send method, see: IMessageProducer.cs

/// <summary>
/// Sends the message to the default destination with the explicit QoS
configuration
/// </summary>
void Send(IMessage message, MsgDeliveryMode deliveryMode, MsgPriority
priority, TimeSpan timeToLive);

Regards
Tim.


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message