1 00:00:01,730 --> 00:00:04,180 In theory everything inside of our cluster is now working. 2 00:00:04,190 --> 00:00:08,900 We should have perfect communication between our post pod and the event plus pod as well. 3 00:00:08,900 --> 00:00:10,310 We actually test this stuff out. 4 00:00:10,310 --> 00:00:15,740 We're going to make a POST request to oppose an attempt to create a new post whenever we do that. 5 00:00:15,740 --> 00:00:22,790 Remember that our current implementation should attempt to reach out to the event by service and emit 6 00:00:22,790 --> 00:00:24,540 some kind of event. 7 00:00:24,650 --> 00:00:28,640 We should eventually see some kind of console log or something like that between these two something 8 00:00:28,640 --> 00:00:29,050 it says. 9 00:00:29,060 --> 00:00:33,400 Oh and the event was just emitted or an event was just received or something very similar to that. 10 00:00:33,470 --> 00:00:38,240 So we are going to use that API client called postman which we use much earlier inside the course to 11 00:00:38,240 --> 00:00:45,050 send a post to posts or then use the cubes TTL logs command to just make sure that we see some logging 12 00:00:45,050 --> 00:00:50,060 information related to emitting or receiving some kind of event so let's get to it. 13 00:00:51,170 --> 00:00:55,070 I've already opened up the API client postman so here it is right here. 14 00:00:57,440 --> 00:00:59,320 I can open up a new tab. 15 00:00:59,600 --> 00:01:06,660 We need to make a post request and we're going to make this post request to H TTP and remember we are 16 00:01:06,660 --> 00:01:09,650 trying to access the node port service right now. 17 00:01:09,810 --> 00:01:15,660 That's governing access to the post pod So recall that we spoke about node port services just a little 18 00:01:15,660 --> 00:01:16,280 bit ago. 19 00:01:16,290 --> 00:01:18,140 Let's see where is our diagram for it. 20 00:01:18,150 --> 00:01:19,170 Here is right here. 21 00:01:19,820 --> 00:01:24,910 So remember if we are trying to access some pod that is running inside of our cluster we can use a node 22 00:01:24,910 --> 00:01:29,470 port service and we typically only use those for development purposes which is exactly what we are doing 23 00:01:29,470 --> 00:01:30,790 right now. 24 00:01:30,820 --> 00:01:35,570 Remember that to access that thing we have to use that randomly assigned port that usually starts with 25 00:01:35,590 --> 00:01:36,120 three. 26 00:01:36,160 --> 00:01:42,450 It's in the 30 thousands and the actual you or L that we're going to use depends upon whether you are 27 00:01:42,450 --> 00:01:46,640 using Docker for Mac or Windows or in any cube. 28 00:01:46,660 --> 00:01:50,770 So again if you are making use of many cube you will run many cube IP and that will give you the IP 29 00:01:50,770 --> 00:01:52,570 address that you're going to make your request to. 30 00:01:52,570 --> 00:01:57,740 Otherwise if you're on Docker for Mac or Windows you will use local host to actually get the port that 31 00:01:57,760 --> 00:02:06,800 we need to make the request to we can rerun that cube CDL get Services Command we'll see the Postal 32 00:02:06,800 --> 00:02:14,170 Service right there of type note port and at the very end is the actual port that we use to get to that 33 00:02:14,170 --> 00:02:16,450 node port service from outside of our cluster. 34 00:02:16,450 --> 00:02:18,990 So for me it is 30 for a two for you. 35 00:02:18,990 --> 00:02:28,410 It might be something slightly different so I will put in a local host 30 for 0 2 for you. 36 00:02:28,410 --> 00:02:32,070 You are very likely can have a different port and if you are using mini cube right now you will not 37 00:02:32,070 --> 00:02:33,030 have local host. 38 00:02:33,030 --> 00:02:36,090 Instead you will have whatever IP was assigned to you from any cube. 39 00:02:38,750 --> 00:02:41,300 Then at the very end we're going to make a post request to post. 40 00:02:41,300 --> 00:02:45,690 Of course I'll then go to headers. 41 00:02:45,850 --> 00:02:52,770 I'm going to put in a content type of application Jason. 42 00:02:53,400 --> 00:02:54,620 I'll get a body. 43 00:02:54,690 --> 00:03:02,220 We'll go to RA but in a title of post I can make sure I've got Jason selected over here in the dropdown 44 00:03:03,170 --> 00:03:04,320 and then here's the big test. 45 00:03:04,320 --> 00:03:11,500 I'll hit send and believe it or not status to a one created guy that looks good but that's really just 46 00:03:11,500 --> 00:03:15,160 kind of testing the functionality that we already verified around the node port service. 47 00:03:15,160 --> 00:03:22,290 Let's now start to pull some logs out of our post pod and the event plus pod and make sure that these 48 00:03:22,290 --> 00:03:24,170 things are exchanging events. 49 00:03:25,890 --> 00:03:28,110 So for that I'm going to go back over to my terminal. 50 00:03:28,110 --> 00:03:29,880 I'm going to print out all my different pods 51 00:03:34,270 --> 00:03:41,410 and I'll use the cube Seitel log command to print out some logs from the event plus and the Post's board 52 00:03:42,280 --> 00:03:44,150 though and take a look at post first. 53 00:03:44,160 --> 00:03:55,830 I'll do a cube TTL logs and then paste in that pod name and hey look at that received event post created. 54 00:03:55,850 --> 00:03:58,340 So what does that little line right there really mean. 55 00:03:58,340 --> 00:04:04,010 Well it means that when we created that post our post pod sent a message out to the event bus through 56 00:04:04,010 --> 00:04:10,500 the event bus service it sent out the post created event event bus then took that event and emitted 57 00:04:10,500 --> 00:04:15,600 it to all of the different services that are running inside right cluster right now or I don't really 58 00:04:15,600 --> 00:04:20,250 mean to say that I mean to say specifically right now really just the post cluster IP service. 59 00:04:20,300 --> 00:04:24,600 That means that we were able to send a message to the event bus and receive a message from the event 60 00:04:24,600 --> 00:04:27,380 bus as well and that's pretty much it. 61 00:04:29,320 --> 00:04:33,230 So that's really proof that we can get all this stuff working inside of our Cuban cities cluster. 62 00:04:33,290 --> 00:04:38,000 So now to really wrap up our application and finish up all this kind of Cuban needs introduction stuff 63 00:04:38,420 --> 00:04:42,550 we're going to start to introduce all the other micro services we had put together. 64 00:04:42,650 --> 00:04:49,400 So we are going to create deployments and cluster IP services or comments moderation and query and we're 65 00:04:49,400 --> 00:04:53,750 going to make sure that all these things have the correct you URLs that are going to attempt to access 66 00:04:53,750 --> 00:04:57,330 the event bus or the appropriate micro service and so on. 67 00:04:57,350 --> 00:05:00,050 Let's start that final step of integration in just a moment.