blob: 30cb192297e9bd91f3c89c20d6b6150004b8dfff [file] [log] [blame]
<div class="wiki-content maincontent"><p>The TimeStampPlugin is a Broker interceptor which updates a JMS Client's time stamp on the message with a broker time stamp. This can be useful when the clocks on client machines are known to not be correct and you can only trust the time set on the broker machines.</p><p>Enabling this plugin will break JMS compliance since the time stamp that the producer sees on the messages after as&#160;<strong><code>send()</code></strong> will be different from the time stamp the consumer will observe when he receives the message.</p><structured-macro ac:macro-id="d8a6fa35-c580-419b-889d-e4ace8a7a0f0" ac:name="info" ac:schema-version="1"><rich-text-body>By default this plugin is <em>not</em> enabled in ActiveMQ.</rich-text-body></structured-macro><h4>Options</h4><table><tbody><tr><th colspan="1" rowspan="1"><p><strong>Attribute</strong></p></th><th colspan="1" rowspan="1"><p><strong>Default Value</strong></p></th><th colspan="1" rowspan="1"><p><strong>Description</strong></p></th></tr><tr><td colspan="1" rowspan="1"><p><code>futureOnly</code></p></td><td colspan="1" rowspan="1"><p><code>false</code></p></td><td colspan="1" rowspan="1"><p>When <strong><code>true</code></strong> the plugin will <em>never</em> set a message's time stamp and expiration time to a value lower than the original values.</p><p>When <strong><code>false</code></strong> the plugin&#160;<em>always</em> update a message's time stamp and expiration time.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>ttlCeiling</code></p></td><td colspan="1" rowspan="1"><p><code>0</code></p></td><td colspan="1" rowspan="1"><p>When not zero, this value (in ms) limit the expiration time.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>zeroExpirationOverride</code></p></td><td colspan="1" rowspan="1"><p><code>0</code></p></td><td colspan="1" rowspan="1"><p>When not zero this value (in ms) will override the expiration time for messages that do not have an expiration already set.</p></td></tr></tbody></table><p>To enable the TimeStampPlugin add the following to your ActiveMQ Broker configuration.</p><p>Example:</p><structured-macro ac:macro-id="4aed805d-2fd7-4445-ac97-02362c11d191" ac:name="code" ac:schema-version="1"><parameter ac:name="language">xml</parameter><plain-text-body>&lt;plugins&gt;
&lt;!-- 86,400,000 ms = 1 day --&gt;
&lt;timeStampingBrokerPlugin ttlCeiling="86400000" zeroExpirationOverride="86400000"/&gt;
&lt;/plugins&gt;
</plain-text-body></structured-macro><structured-macro ac:macro-id="6828683a-39ac-4239-9d55-d851e3fbcfa0" ac:name="info" ac:schema-version="1"><parameter ac:name="title"> Broker/Consumer Clock Synchronization</parameter><rich-text-body><p>When the consumer&#8217;s local clock is running ahead of the broker&#8217;s local clock then messages might not be consumed by your consumer when this plug-in is loaded with default configuration as the consumer could perceive the messages as already expired.</p><p>If the clock difference between broker and consumer is <em>greater than</em> the message expiration time <em>and</em> if the consumer&#8217;s clock is running ahead, then set <strong><code>futureOnly="true"</code></strong>.</p><p>See the following <a shape="rect" href="http://tmielke.blogspot.com/2011/01/sync-your-machine-clocks.html">blog post</a> for more details.</p></rich-text-body></structured-macro></div>