4 Replies Latest reply: May 16, 2012 11:18 AM by Andy Taylor RSS

How is time and timezones used in relation to TTL on messages?

Kent Garner Newbie

I am currently working on a project that uses a topic as a central repository for separate application to publish status messages. 

The messages are consumed by one or more display application for users to monitor system activities. 

The messages are designed to be short lived and are published at a rate of one per second  their TTL is set for 10 seconds. 

 

I recently came across a scenario where my windows host was running with at timezone of GMT-5 and DST was on. 

The Solaris server that was hosting my Hornetq Topic was running with a timezone of GMT 0 DST was off.

 

I could not get any messages that were published from the windows host to appear on any consumer status window. 

After considerable testing I came to the conclusion that I had to increase my TTL for the status message to be more than 6 hours in order for the messages to appear. 

Newer versions of Hornetq would actually log that the messages were received as expired unless the TTL exceeded the (timezone + DST+ time drift) differential.

 

Is the TTL calculated from a timestamp in the message header from the sending host?  I do not know how to make this work in my environment. 

How can I assume all of the hosts that my customers use have their time in sync ( - rhetorical can't ) .

 

If I increase my TTL to the extent necessary here I am going to have a crap load of messages building up in my topic and wasting precious drive space.

I made the assumption that the TTL was based off the time the message was received by the server not send by the client.

 

How have other people handled this when communicating between separate hosts?