-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outbox cleaning using Time-To-Live does not work #127
Comments
The problem is we cannot really take the outbox TTL into account because the setting might be changed which then would change the table TTL which is fairly problematic. In addition we are only creating the default shared table which also contains other data. The outbox TTL is supposed to influence outbox records added the time of setting as dispatched. So the sensible way to address this would be to set the default TTL on the created table to
https://docs.microsoft.com/en-us/azure/cosmos-db/time-to-live#time-to-live-configurations |
Additionally, we are currently using
|
Here is a suggestion #128 |
Version https://github.com/Particular/NServiceBus.Persistence.CosmosDB/releases/tag/0.2.1 with the fix was released |
Symptoms
Outbox records for dispatched messages are not evicted.
Who's affected
Anyone using Cosmos DB persistence with outbox feature enabled.
Root cause
CosmosDB doesn't have a normal "outbox cleaner" but uses a TTL feature so that the record is automatically deleted after the TTL is complete.
Except according to the docs linked above, if the container TTL is set to null then it doesn't matter what the per-item TTL is set to—the item will never expire.
The container is created here and does not include setting a TTL, so outbox records will never expire.
Containers should be created with a default TTL of
-1
which still means "no expiry" but will allow per-item TTLs to work correctly.Workaround
Manually update the TTL of the container to On (no default).
Plan of action
The text was updated successfully, but these errors were encountered: