In this video, we are going to test kinesis data streams for using a lambda to process kinesis data
streams.
So that means we will send item to Kinesis data streams and these will be pulled from the database.
Lambda and invocation will be happen from the lambda function.
Okay, let's get started.
Please open the widgets to the code.
As you remember that we have developed our lambda function code for iterating incoming records and we
will decode the incoming kinase theta and log the payload of the data.
Okay, so if you look at the event JSON object, you can see that the whole data is transferred with
the base 64 encode way in the data of the Kinesis section.
So we will try to see which data goes to with this example record and even JSON.
In order to do that, please open the console, go to Kinesis function and go to test section and create
a new test event name, which is the test kinesis.
And if you select the kinesis.
Data streams we can select here and see the example event JSON file.
And if you scroll down, I'm going to save this event template and click the test button and this will
be in our lambda function and you can see the execution performed successfully.
If you go to monitor and we've included looks, we should see the decode value of the these data streams
and we will log these value into our cloud watch logs, open the latest cloud watch logs here you can
see the incoming event, JSON from the kinesis and these are the basics for encoded value.
And if you scroll down, you can see the decoded payload in here.
This is basically a text message which is the halo.
This is test one, two, three.
So you can see the decoded way and we look this decoded way in here and we can perform any business
logic after decode this payload comes from the kinesis.
Okay.
This is one way to test our kinesis data streams and another way is using cloud commands.
If you come here and get the kinesis name, as you remember that we have Amazon Kinesis and if you go
to data systems, we have a test stream.
If you open the Visual Studio code, I have create separate lecture and section folder.
And if you go to command text file, you can see the example CLI command that is using the kinesis,
put record API and we are placing the city name.
Our city name is disk kinesis and we have give you the partition key.
Also provide the data.
Data is a text message as you can see in here.
Let me run this command and see what's happened.
We are trying to put record in the place kinesis.
Please go to lecture folder and hit the enter for running this command which is the kinesis put record.
So as you can see that it is getting error because it is in base64.
So that means we will decode these message before we put into Amazon Kinesis.
In order to do that, I'm going to use a web application.
You can see in here we basically convert base 64 and controller.
So let me copy this text message and come here.
You can see the base64 encode value and after that you can paste these value as a data.
And let me see, it is the same.
Yes, it's totally the same data.
So basically you can paste the data into here with providing the base64 encode value.
And after that, if you copy and paste this command, this command will be input item to kinesis data
streams and this stream will be pulled from the lambda and invocation happens from the lambda function.
OC As you can see that we have successfully test kinase streams using a lambda to process kinesis streams.
At this point, I would like to give you an assignment that you can develop with your environment here.
You can find the article that we mentioned before.
So basically this article explains how to perform order data replication into Amazon dynamic DB streams.
But if you scroll down, there is three way to use Stream's panel pattern.
You can see that you use finite patterns to process the A.B.C. stream and there is three way to handle
this operation.
So this time I would like to give Kinesis data stream panel pattern.
If you scroll down and see the architecture, you will see that we will conduct a kinesis stream to
to provide the final pattern.
So this is an assignment that you can follow and that you can do on your environment.
So we have finished this section.
That means we have finished the streams, both Dynamo DB and Kinesis Stream and using to add some of
the functions.