0:00 All right, so now at this point, we can actually test out our new circuit 0:04 breaker implementation. So make sure, of course, that our development 0:07 server is up and running. 0:10 So you can see here we're up and running, and we actually already have everything 0:14 we need set up to actually test out our circuit 0:18 breaker functionality. Now, remember, we already have everything we need to 0:22 actually test this out. If we head back into our application and 0:26 open up our demo controller, remember we have our get route 0:30 here called call, and this is going to use 0:34 our injected HTTP service, which we now know 0:38 is wrapped around the HTTP circuit breaker now. 0:42 And so this is very useful because it uses the HTTP service to make a 0:46 get request to our upstream route, which is the 0:50 same server underneath the hood, but it is still a 0:53 network call that goes through Axios. 0:56 And so remember, that's inside of the upstream controller 0:59 here on the unstable 1:00 route, where we will throw in an HTTP 1:04 exception if there is a failure. In this case, we can 1:07 control the rate of failure to actually simulate how 1:11 frequently we want that to occur. Now, one more thing I want to actually 1:15 add to our call 1:18 here is actually return back the HTTP breaker stats. 1:22 Now, to do this, I'm going to head back into the HTTP 1:25 service, 1:27 and let's scroll down and add a new method underneath our 1:31 get call that I'll call get breaker stats. 1:35 And all this is going to do is reach out to the HTTP breaker 1:38 that we've already 1:38 configured. 1:40 And on here we have a stats object, which will return back the 1:44 current status and state of the underlying breaker, which is 1:48 going to be nice and useful to see as we debug and use and test out this
The rest of the transcript is for members.
Sign in