-
Notifications
You must be signed in to change notification settings - Fork 3
CCM-12616 mesh poll retrieve #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
d1e3058 to
331d6c4
Compare
gareth-allan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a couple of minor points.
| scripts/**/*.*, \ | ||
| docs/**/*.*, \ | ||
| utils/py-mock-mesh/**, \ | ||
| utils/event-publisher-py/event_publisher/mesh_config.py, \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should mesh_config.py not have some test coverage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have any tests for the config files in core, so I didn't bother. I can add them if we think they're needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does quite a lot, so it might be nice, but I won't block the PR for this. We could always put a TD ticket in perhaps?
tdroza-nhs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous comments addressed
| from pydantic import BaseModel, ConfigDict, Field, field_validator | ||
|
|
||
|
|
||
| class CloudEvent(BaseModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll need to update the schema otherwise the consuming components will fail when validating them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should now be done.
ca56d6e
c7076d1
….com/NHSDigital/nhs-notify-digital-letters into feature/CCM-12616_mesh_poll_retrieve
Description
This PR introduces two components that together implement the full workflow for pulling and downloading requests submitted to the MESH mailbox.
The first component, mesh-poll, runs every five minutes, reads messages from the MESH inbox, extracts metadata from the message headers, including meshMessageId and messageReference (the MESH local_id), validates the sender by comparing the message’s mailbox ID against sender configurations stored in SSM, and resolves the corresponding senderId. Once validated, mesh-poll publishes a MeshInboxMessageReceived CloudEvent containing senderId, meshMessageId, and messageReference.
The second component, mesh-download, consumes these events via SQS, retrieves the MESH message using the meshMessageId, stores the document in the PII S3 bucket under the document-reference/{senderId}_{messageReference} key, acknowledges the message in MESH (removing it from the inbox), and finally publishes a MeshInboxMessageDownloaded CloudEvent.
Note:
In development environments, the pipeline uses mock MESH
Utils Added
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.