Scylla JS has rate limiting. Turns out we need it for rust as well. It basically involves discarding any message that is sent within 100 ms (by default) of the last message per topic name.
Acceptance Criteria
Can change the overall minimum time
If done after #182, make this an atomic setting with an edit endpoint
Performance hit is minimal
Proposed Solution
At the db handler layer introduce a HashMap<String, DateTime> or something which stores the time the last message came in. Do this only for messages that are not considered special types (i.e. messages we plan to batch insert). If the difference in time of a new message is smaller than the 100ms or whatever setting, discard the message and bail out of the processor. If it is greater store the new time in the hashmap and continue processing the data.
Description
Scylla JS has rate limiting. Turns out we need it for rust as well. It basically involves discarding any message that is sent within 100 ms (by default) of the last message per topic name.
Acceptance Criteria
Proposed Solution
At the db handler layer introduce a HashMap<String, DateTime> or something which stores the time the last message came in. Do this only for messages that are not considered special types (i.e. messages we plan to batch insert). If the difference in time of a new message is smaller than the 100ms or whatever setting, discard the message and bail out of the processor. If it is greater store the new time in the hashmap and continue processing the data.
Mocks
No response