[Bug] PagedOutstandingCommand query in MySQL Outbox subtracts seconds instead of milliseconds, causing OutboxSweeper to function incorrectly
Describe the bug
PagedOutstandingCommand query in MySQL Outbox subtracts seconds instead of milliseconds, causing OutboxSweeper to function incorrectly. This should be an easy fix.
To Reproduce
Set up the OutboxSweeper with MinimumMessageAge set to 5000 milliseconds (5 seconds)
The OutboxSweeper will dispatch messages that are older than 5000 seconds (instead of 5 seconds) due to an incorrect query:
public string PagedOutstandingCommand { get; } = "SELECT * FROM {0} WHERE DISPATCHED IS NULL AND Timestamp < DATE_ADD(UTC_TIMESTAMP(), INTERVAL -?OutStandingSince SECOND) ORDER BY Timestamp DESC LIMIT ?PageSize OFFSET ?OffsetValue";
Further technical details
- Brighter version: 1.0.0-preview.3
- The OS: Windows
This may be fixed now, will check and fix if not
We may fix this by looking to move our API from milliseconds to TimeSpan for clarity @preardon @holytshirt @dhickie in V10
Fixed as part of TimeSpan fixes