Skip to content
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

6 async microservices communication #4

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

manguianoepam
Copy link
Owner

No description provided.

Michelle_Anguiano added 13 commits August 2, 2022 19:57
Corrected get-product.js
Added console.log()
added webpack.config.js
- added .env
- added db connection
- added .env
- added db connection
- added images.js
- added image.js
- added test for lambda
- added webpack.config.js
- added serverless.yml configuration
- modified image.js
- added sns
- added sqs
- sns fixed
- added test for batch-process.js
- modified process to create a product
- added config to send message to sqs
- added test for batch-process.js
- modified process to create a product
- added config to send message to sqs
@st3venrose
Copy link

Hi! Could you provide a description of this PR about what was done and what is missing? Thanks!

@manguianoepam
Copy link
Owner Author

Hi! Could you provide a description of this PR about what was done and what is missing? Thanks!

Done:
Create a lambda function called catalogBatchProcess under the same Serverless config file (i.e. serverless.yaml) of the Product Service which will be triggered by an SQS event.
Create an SQS queue called catalogItemsQueue, in the resources section of the same serverless.yml file.
Configure the SQS to trigger lambda catalogBatchProcess with 5 messages at once via batchSize property.
The lambda function should iterate over all SQS messages and create corresponding products in the products table.
Create an SNS topic createProductTopic and email subscription in the resources section in serverless.yml of the Product Service.
Create a subscription for this SNS topic with an email endpoint type with your own email in there.
Update the catalogBatchProcess lambda function in the Product Service to send an event to the SNS topic once it creates products.

Missing:
Update the importFileParser lambda function in the Import Service to send each CSV record into SQS.
It should no longer log entries from the readable stream to CloudWatch.

@st3venrose
Copy link

Where do you set an email address to SNS?
I think the filter policy is also missing:
+1 (All languages) - set a Filter Policy for SNS createProductTopic in serverless.yml (Create an additional email subscription and distribute messages to different emails depending on the filter for any product attribute)

@manguianoepam
Copy link
Owner Author

Where do you set an email address to SNS? I think the filter policy is also missing: +1 (All languages) - set a Filter Policy for SNS createProductTopic in serverless.yml (Create an additional email subscription and distribute messages to different emails depending on the filter for any product attribute)

I forgot to add that part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants