1
00:00:00,210 --> 00:00:07,680
In this video, we are going to create list and delete Q on Amazon space using the Adobe SDK libraries.

2
00:00:07,890 --> 00:00:13,710
So we will create a Node.js application and use SDK libraries to perform these actions.

3
00:00:13,710 --> 00:00:18,960
And we will use these commands which are the create queue command, get queue, command, delete queue,

4
00:00:18,960 --> 00:00:20,400
command and list queue command.

5
00:00:20,400 --> 00:00:22,620
So let's check the SDK documentation.

6
00:00:22,620 --> 00:00:27,930
If you come to client documentation and search for the create queue command, you can come the create

7
00:00:27,930 --> 00:00:33,210
queue command and this command basically perform the creating queue on Amazon environment.

8
00:00:33,300 --> 00:00:39,060
You can scroll down and see the example usage and if we can check the input parameters, we can go to

9
00:00:39,060 --> 00:00:42,720
create queue command input and see the parameters in here.

10
00:00:42,720 --> 00:00:45,660
It is required to queue name attributes and tags.

11
00:00:45,840 --> 00:00:48,930
So for that purpose let's start the implementation.

12
00:00:48,930 --> 00:00:54,300
Please open the Visual Studio code and I have create a separate section and lecture folder.

13
00:00:54,300 --> 00:00:58,470
In here we can see the section 35 and lecture folders.

14
00:00:58,470 --> 00:01:03,660
So in the lecture 293 will be the our main Node.js application.

15
00:01:03,660 --> 00:01:08,820
And during the rest of the videos we will use this lecture folder as a Node.js application to interact

16
00:01:08,820 --> 00:01:09,860
Amazon SDKs.

17
00:01:09,900 --> 00:01:14,790
So you can see the command text file that I'm going to put some comments in here.

18
00:01:14,820 --> 00:01:20,070
We will use these commands when implementing our use cases and we will follow these steps.

19
00:01:20,070 --> 00:01:25,890
We have creating a Node.js application with NPM in command and install required skills package.

20
00:01:25,890 --> 00:01:32,280
And after that we will create a client JavaScript Node.js file to perform client operations interacting

21
00:01:32,280 --> 00:01:33,420
with Amazon SDKs.

22
00:01:33,420 --> 00:01:36,300
So let me start with the NPM command.

23
00:01:36,300 --> 00:01:40,380
Please open the terminal and locate the correct folder structure.

24
00:01:40,380 --> 00:01:45,150
And after that run this command and PM y and hit enter.

25
00:01:45,180 --> 00:01:50,850
This will create a package JSON file for our application and this folder will be our Node.js application.

26
00:01:50,850 --> 00:01:58,140
The first thing we should do that is set the type information as a module in order to gain a script.

27
00:01:58,140 --> 00:02:03,510
Six Standards Please save the package JSON file with the type module information.

28
00:02:03,510 --> 00:02:09,840
And after that, the second thing we should do is install required a basic package, which is the client

29
00:02:10,080 --> 00:02:11,340
case in our case.

30
00:02:11,340 --> 00:02:15,390
So I'm going to copy and paste this NPM, install command and hit enter.

31
00:02:15,570 --> 00:02:23,170
So this will be update or package JSON file and create node modules in order to adding the client space

32
00:02:23,190 --> 00:02:25,260
library classes.

33
00:02:25,260 --> 00:02:27,180
So this takes some time.

34
00:02:27,300 --> 00:02:28,080
Okay.

35
00:02:28,110 --> 00:02:30,480
The installation is successfully finished.

36
00:02:30,510 --> 00:02:35,610
If you open the package JSON file and scroll down, you can see the dependencies added successfully

37
00:02:35,610 --> 00:02:37,710
and no modules are created successfully.

38
00:02:37,740 --> 00:02:43,440
Now we can use this SDK library to interact with the Amazon space.

39
00:02:43,440 --> 00:02:48,270
So in order to do that, let's go back to our commands and see what's the next step.

40
00:02:48,450 --> 00:02:53,460
The next step should be always create a client object which a separate Node.js module.

41
00:02:53,490 --> 00:02:58,410
So it is a best practice to create a separate Node.js module for client object.

42
00:02:58,410 --> 00:03:00,540
So I'm going to create a space client.

43
00:03:00,570 --> 00:03:08,100
Now I can close the terminal and let's go to the folder and create a client JavaScript file.

44
00:03:08,130 --> 00:03:16,200
And we are going to copy and paste this code for creating an X client and using the client library object

45
00:03:16,200 --> 00:03:19,050
from the SDK of the Client SDK.

46
00:03:19,050 --> 00:03:24,780
And this will be exporting our client object to perform the case operations.

47
00:03:24,780 --> 00:03:26,910
We will send command to this client object.

48
00:03:26,910 --> 00:03:32,790
This will be separate Node.js application and now we are ready to perform our business logic which are

49
00:03:32,790 --> 00:03:36,030
the create queue list, queue and delete queue.

50
00:03:36,060 --> 00:03:39,720
We will use this command operation to perform these use cases.

51
00:03:39,720 --> 00:03:42,390
So let's get started for that purpose.

52
00:03:42,390 --> 00:03:47,160
Please open the Visual Studio code and I'm going to create a separate JavaScript file.

53
00:03:47,160 --> 00:03:49,770
For example, create queue dot JavaScript.

54
00:03:49,800 --> 00:03:52,860
This is very similar with the other modules.

55
00:03:52,860 --> 00:03:59,970
So basically we will use create queue command from the client as a basic library and we also import

56
00:03:59,970 --> 00:04:06,000
our client to interrupt our operations and we are using these commands with pacing parameters.

57
00:04:06,000 --> 00:04:07,470
Parameters are in here.

58
00:04:07,500 --> 00:04:08,880
The queue name is important.

59
00:04:08,880 --> 00:04:10,500
We are going to create a new queue.

60
00:04:10,500 --> 00:04:14,370
The name is the queue and we can set the attributes in here.

61
00:04:14,370 --> 00:04:17,010
Basically we set the delay seconds.

62
00:04:17,010 --> 00:04:19,410
This is the number of seconds which delay.

63
00:04:19,410 --> 00:04:21,870
So also message retention period.

64
00:04:21,930 --> 00:04:24,930
This is the number of the number of messages.

65
00:04:24,930 --> 00:04:27,780
Retention period dates values are the default values.

66
00:04:27,780 --> 00:04:29,280
That's why I set the default values.

67
00:04:29,280 --> 00:04:33,510
But we can change the attributes when creating any queue command on the space.

68
00:04:33,510 --> 00:04:36,840
So after that we will have a run method.

69
00:04:36,840 --> 00:04:42,900
This is the single output and we have available client send method that we passing to command and parameters.

70
00:04:42,900 --> 00:04:47,310
So this is the create queue command that we are going to create a queue now.

71
00:04:47,310 --> 00:04:53,070
So appeal is terminal and go to correct location and click the run node.

72
00:04:53,990 --> 00:04:58,640
Bait paid to command, write the note, create Q comment and hit enter.

73
00:04:58,660 --> 00:05:00,580
So this is going to create a queue.

74
00:05:00,610 --> 00:05:05,120
You can see that we got 200 success response and queue in here.

75
00:05:05,140 --> 00:05:07,720
We can copy the queue in some place.

76
00:05:07,720 --> 00:05:14,310
So we will use this queue record after that and and we will verify from the queue on the end of this

77
00:05:14,350 --> 00:05:15,010
management console.

78
00:05:15,010 --> 00:05:18,840
But before that let me copy and paste in in here.

79
00:05:18,850 --> 00:05:26,290
So now let's verify from the measured console to see the Amazon queue is created or not go to SKUs.

80
00:05:26,290 --> 00:05:32,230
So see that we have successfully create a new queue which has given parameters and attributes.

81
00:05:32,230 --> 00:05:35,140
So we basically perform the create queue operation.

82
00:05:35,170 --> 00:05:37,990
Now the second option is listing queue.

83
00:05:38,020 --> 00:05:44,590
So if you come here and create a separate JavaScript file, which is the least queue JavaScript, this

84
00:05:44,590 --> 00:05:45,300
is very similar.

85
00:05:45,310 --> 00:05:50,620
This time we will use list queue command and there is no any parameters required for this command.

86
00:05:50,650 --> 00:05:58,210
This is listing to queue on Amazon has for that purpose and directly run node command for the list queue.

87
00:05:58,240 --> 00:06:06,370
If you run the node list queue and hit enter, this will be listing the old queue URLs in here.

88
00:06:06,370 --> 00:06:09,730
Since we have one queue, you can see the queue in here.

89
00:06:10,000 --> 00:06:13,600
Now we have one more command which is the delayed queue command.

90
00:06:13,630 --> 00:06:18,180
You can go to the documentation and see the delayed queue command in the commands.

91
00:06:18,190 --> 00:06:24,850
If you search for the delayed queue command, if you open this delete queue command, see the example

92
00:06:24,850 --> 00:06:30,670
usage which is the command and this is the input and make sure that you have input parameters including

93
00:06:30,670 --> 00:06:31,570
the queue URL.

94
00:06:31,570 --> 00:06:36,790
So that's why I saved the queue to perform this operation, open the widgets to the code and create

95
00:06:36,790 --> 00:06:39,850
a separate JavaScript file which is the daily queue.

96
00:06:40,060 --> 00:06:47,590
JS So this time I'm going to pass a queue URL, so that's why I'm going to copy this URL and paste in

97
00:06:47,590 --> 00:06:49,690
here and save this file.

98
00:06:49,720 --> 00:06:56,470
So now you can see that we use the queue command with passing to queue in the parameters and using the

99
00:06:56,980 --> 00:06:58,780
client that sent operation.

100
00:06:58,780 --> 00:07:03,010
So let's perform the delayed cooperation with Node Command.

101
00:07:03,010 --> 00:07:08,020
I'm going to write note, delete, queue that JS and hit enter.

102
00:07:08,810 --> 00:07:13,650
See that we have successfully delayed our queue to verify from the console.

103
00:07:13,820 --> 00:07:20,630
Go to the management console and open the Amazon queue and refresh the page and see that our queue is

104
00:07:20,660 --> 00:07:21,860
deleted successfully.

105
00:07:22,130 --> 00:07:29,180
As you can see that we have successfully perform create list and delete Q on Amazon is using the Sdhc.
