In this video we are going to deploy and test basket microservices.
We will test from the scratch, which is the HTTP post request with the payload of the API gateway.
And this will be invoke our basket, lambda microservices basket and the microservice will be published.
Check out event to the Amazon event which is custom event pass.
And this will be run the event pattern and after that match the event and target the event to the Amazon
case and notification microservices.
Amazon is pulling from the ordering microservices and we will check the invocations ordering and notification
microservices and see the logs from the cloud watch logs.
Let's get started.
Please open the pseudocode and let's start with the right click and reveal the next word.
Select all and remove commands right click and send to compress it.
And I'm going to give the name a zip file as a basket RMS.
And this will be our deployment package that we are going to deploy to our Islam environment.
Please go to the slum, the environment and open the basket microservices and in here please select
the upload from zip file and click the upload button.
Select the correct PEC, which is the section 43 and lecture 346 and select the basket MSG, Zip file
and click the save button.
This will be deploy our Node.js application to the Lambda Function of MMS.
Let's get microservices.
So see that we have successfully deployed.
If you scroll down, we should review the code into the code window if there is an exception or not.
See that we don't have any exceptions.
So we are ready for the test.
Now, in order to test this whole architecture, I'm going to send request to the post API Gateway of
the Basket API gateway.
If you open the API gateway as you remember that we have create basket API and you can see the stage
and deploy the URL for the basket inaugural.
Copy this URL and go to the postman.
So I'm going to send a post request to this URL and with passing body information, role and JSON object.
And in the JSON object, if you open the videos to the code and go to commands, as you remember that
these are the expected payloads that we are going to send to a CDB six copy this payload and paste in
here.
So if you check the center HTTP post request, this will go to basket microservices and return back
to synchronous response.
You can see that we have got successful response from the basket microservice synchronously.
So if we scroll down you can see the entry is also and we have a one event idea that triggered and published
from the basket microservices to the Amazon event page and we can see the entries and event ID in here.
Very good.
So if you go back to our architecture, we basically sent post to basket API API Gateway and this will
direct to the basket microservices and invoke the lambda function and this lambda function, publish
checkout event, Amazon event page and response back to us our synchronous response and we will check
now Amazon event page and this will be targeted to case and notification microservices.
Let's check all cloud folks one by one.
I will start with the basket microservices.
If you open the lambda functions in the basket microservices, go to monitoring and weaving cloud watch
logs so you can see how API gets triggered to our basket microservices here.
You can see that this is the invocation comes from the API gateway.
There is a resource PID and if you scroll down you can see the body information, you can copy this
JSON object and go to the our command section.
So basically we will create a new lecture folder which is the.
Lecture.
And I'm going to add a Neve file, which is the basket.
You want.
But Jason, I would like to copy paste all the Jason's from the old microservices here you can see the
basket event Jason file.
So now please go back to our lambda functions and follow the same steps if you come to functions.
So I'm going to continue to notification microservices if you check the notifications, monitoring and
viewing logs, see that notification event.
Jason How to trigger from the location.
If you open the latest log stream, you can see that we have got successfully triggered from the our
Amazon event page to lambda function of notification microservices.
Here you can see the event we have the trade app checkout basket and source is here and you can see
the details in here, icon and price and so on.
So if you copy this file and also I will save this file into our test lecture.
So here you can find the notification event, that JSON file.
This is the incoming event from the Amazon event.
Okay.
Now I'm going to go to ordering microservices.
If you open the functions and go to order microservices, these will be pulled from the case.
For that purpose we can see different incoming event to order microservices, so go to latest log stream
and see invocation and here you can see the incoming event JSON from the case.
If you go here and click to order event JSON and paste in here.
So as you can see that this time we saw the records array because order pull events from the case and
the record start.
But the information we can see actual event which comes from the Amazon event page, you can see the
detail type check out source in here.
And also our actual payload is including the detail of this payload and we should get the detail and
after that we should pass the JSON and reach the our actual JSON payload, which is coming from the
Amazon API gateway.
Okay.
Very good.
So if we go back to the management console and go to the Amazon event page, we can review the our rule
and how rule is work.
First of all, we should select our customers, which is a checkout basket event pass.
If you open the checkout basket rule or event is comes this rule and this rule is run this event pattern
and this payload is matched to our event pattern because the tail type and source equal and after that
sent to our event, publish this event to the target systems which are the order queue and notification
microservices.
So as you can see that we basically complete end to end architecture.
So now we are going to handle this message coming from the basket microservices to do and accommodate
these message into order microservices and interact with the dynamic DB table.
So in the next video we will develop the order microservices with the incoming event from the Amazon
SDKs and interact with the Dynamo DB.