Doubt about TTL

I have a doubt regarding broker. Suppose if there is a document and its document storage type is Guaranteed and the TTL for that document is say some X seconds and the client storage type is also Guaranteed. Question is if the client didnot subscribed that document with in that Time To Live period, is the broker going to delete that document or going to store it on the disk.
Sorry it might be a silly question but iam confused with this.

If a subscription does not exist for a document, the TTL doesn’t matter. The document will not be delivered anywhere.

If a subscription exists, but the subscriber is disconnected, the TTL determines how long the document will remain active. If the TTL expires before the subscriber retrieves the document, the subscriber will never receive the document. It will be as if the document never existed. It does not matter what the storage type is.

If you need a document to absolutely get to subscribers, set the TTL to forever. Normally, a TTL is applied to request documents in a request/reply interaction and should complement the pubAndWait timeout. If the responder is off-line for a period of time (that exceeds the TTL/timeout) then there is no sense in delivering the request when the responder comes back on-line as there will be noone listening for the response.

A TTL can be set on “normal” pub/sub documents too. This may make sense for time-sensitive data. For instance, say a current price document is published every 15 minutes. Subscribers only care about the latest price. if a subscriber is down and misses one or more of the events it would be meaningless for it to receive the old events.

Use of TTL is common in request/reply operations. Meaningful use of TTL in other scenarios is quite rare.

Thanks Rob Eamon for making me clear.

So if ther subscriber doesn’t pick up the document by the time TTL expires, does Broker remove that doc from the Broker store eventhough it’s Guaranteed??



I dont think that the documents would be removed from the guaranted storage once the ttl live expires.


It is my understanding that the storage mode (volatile or guaranteed) is independent of the time-to-live property of the event type. When the TTL expires, the event is removed regardless of the storage type. The wM Broker docs make no reference to special handling for guaranteed storage when describing TTL.

Remember that for the guaranteed storage type, “guaranteed” refers to the storage mechanism and nothing else. A guaranteed doc type simply indicates that the Broker writes the docs of that type to disk (using a two-phase commit) in an effort to avoid losing documents in the face of hardware, software or network failures.

But the notion of having guaranteed document types with a TTL does seem a bit wierd. Normally, doc types with a TTL will use volatile storage.