New: [AEA-5308] - Add NHS Notify callback lambda#1634
Conversation
|
There are currently hardcoded values such as |
| ) | ||
|
|
||
| const parsedMessages: Array<PSUDataItemMessage> = Messages.map((m) => { | ||
| const parsedMessages: Array<NotifyDataItemMessage> = Messages.map((m) => { |
There was a problem hiding this comment.
The current logic in drainQueue will throw and abort processing if any SQS message in the batch is malformed (for example, if a message is missing a Body, has invalid JSON, or does not match the expected structure). This means that a single bad message will prevent all other messages in that batch from being processed, which is an explicit design choice.
If this is intentional (for example, to avoid partial processing or to surface bad upstream producers quickly), this behavior is correct. However, if we ever want to make the function more resilient - so that only invalid messages are skipped and valid ones continue processing - we would need to refactor this logic, possibly by adding per-message validation and error handling.
For now, as long as the intended policy is to reject the whole batch on any error, this approach is consistent with that goal. If requirements change, we can revisit this for more granular handling.
|



Summary
Details
Adds a lambda function which receives callback notification updates, and stores them in the relevant dynamo table