-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TimeToLive to PriorityQueue (#2750)
Adding TimeToLive to MessageStore and adding integ test. With the addition of priority queues, we also now have the TTL for each route, instead of for each MessageStore. This PR changes the MessageStore to be aware of the TTL for each message and use the TTL for each message as the source of truth for TTL. If a message has no TTL specified, it gets a default value of '0.' Messages with default value of 0 take from the global TTL of the MessageStore. Note: Because message stores are per endpoint per priority, there could be multiple routes that use the same MessageStore. When CleanupProcessor runs, it assumes that the head of a MessageStore (you can think of a MessageStore as a queue) is the oldest message and that all the messages have the same TTL. Therefore, it assumes that it doesn't need to check past the first unexpired message it finds. Now, it is possible to have messages in the same queue with different TTL's. This PR just allows the store to pile up with expired messages, so long as the head is unexpired. In a future PR, we will allow another option - to go through the entire list each time to find expired messages. It's a tradeoff between I/O and DB space, so we can make it configurable.
- Loading branch information
1 parent
2554c01
commit 2662d9c
Showing
5 changed files
with
125 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters