Deposit Update Message Handler

Deposit Update Message Handler

Legacy

Area metatdata-deposit
Description Python script deployable as a lambda that can update deposit statuses in mongodb
Quality No Sentry, no SONAR
Upstream data
Source Code
Related services
Tags

Purpose

The Deposit Update Message Handler is responsible for handling notifications sent via the deposit system so that deposits recorded in mongodb by the REST API have their statuses updated.

Process

The following diagram shows the pipeline for a deposit update.

Pre Handoff

When a deposit is made via the REST API the deposit is stored in mongodb and handed off to the deposit system.

graph LR; deposit(api.crossref.org/v1/deposits); process(Process Deposit); store(mongodb); depositHandoff(Deposit Handoff); deposit-->process; process-- Store -->store; store-->depositHandoff; click depositHandoff "../rest-api-cayenne/deposits/" "Deposit Handoff";

Post Handoff

When the deposit system finishes processing and the handoff is complete a notification is sent via email. This notification is handled by a function running in AWS Lambda and the notification persisted in S3.

graph LR; notificationEmail(Notification Email); ses(SES mailbox) s3(AWS S3) lambda(AWS Lambda) notificationEmail-->ses; ses-->s3; ses-->lambda;

Handler

The Deposit Update Message Handler function runs in AWS Lambda. It extracts error/success information from the email notification and updates the deposit status in mongodb.

graph LR; lambda(Deposit Update Message Handler) s3(S3) parse(Parse Notification) calculateStatus(Calculate Status) mongodb(mongodb) lambda-->s3 s3-- Download notification -->lambda lambda-->parse parse-->calculateStatus calculateStatus-- Update Status -->mongodb