-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
-
False
-
-
Although documented differently, the AWS Marketplace API will only accept usage that is within a window of 6h. Note that this doesn't necessarily represent a message age of 6h. The message timestamp must be on or after the START_OF_CURRENT_HOUR - 6h
For example, let's say that it is currently 2023-10-26T13:30:00Z. Any message that has a timestamp that is on or after 2023-10-26T07:00:00Z will be accepted. Therefore, a message sent with a timestamp of 2023-10-26T07:00:00Z }} would be accepted up until the current time is {{{}2023-10-26T14:00:00Z.
Some more examples, using the current time of 2023-10-26T13:30:00Z are as follows. Consider a message with the following timestamps:
- 2023-10-26T13:00:00Z == VALID
- 2023-10-26T07:00:00Z == VALID
- 2023-10-26T06:59:59.999999Z == INVALID
- 2023-10-26T05:30:00Z == INVALID
In order to avoid sending requests to the AWS API that we know will fail, the AWS producer should check that the incoming usage is within this window before sending the usage to AWS.
If the usage is outside of this window, the usage should not be sent to AWS, a WARNING message should be logged, and an 'ignored' micrometer counter should be incremented.
AC:
- The AWS producer should utilize a configuration property to allow adjusting the window (default to 6h).
- Usage is not sent to AWS when incoming usage is older than the configured window (mimicking the logic defined by the AWS API).