In this video we're going to go into our post application and update all the requests that we're making
over a two hour event us to use the name of the event bus service.
Well then do the same thing with the event bus so we'll open up the event bus code and each time we
try to make a request over to our post service or the post application.
We'll make sure we update that you all as well as you can guess.
We are going to start to add in eventually some new pods for our comet stuff for moderation and query.
Those are all going to need some services to be created as well.
And we're going to need to make sure that for each of those services we update all the appropriate URLs
inside of our codebase too.
So eventually we're going to have to update a lot of your else.
But right now let's just focus on posts and event buzz and just get those two things working.
All right.
So inside of our code Ed we're going to find our postal application once again and find the index not
just file but here's where we are making a post request to slash posts or we had the handler for it
and this is where we reach out to revamp US.
So no longer are we going to make a request to local host.
Instead we make a request to the service that is governing access to the event bus.
So it will be event bus as Savi and it's absolutely always worth when you type in one of these service
names inside of your code.
Always worth going over to your terminal.
Doing a quick cube Seitel.
Get services and just double checking the spelling and also double checking the port as well.
The event bus SRB at port four thousand and five does that line up.
Yes it does then continue down and see if there are any other requests being issued in here to our event
bus.
No I don't think there are.
It's all save this file and close it all then go over to my event bus all about the index not just file
inside there as well.
This is where we are making our series of request to all the different sub or micro services we have
inside of our at so at present.
We don't have any implementation or comments moderation or query.
So I'm just going to temporarily comment those out.
We'll come back in uncommon them very shortly as we start to bring the comments moderation and query
micro services live inside of our cluster.
But right now if we tried to make a request to those endpoints we would end up with an error.
Probably not what we want so we'll just leave behind the request to our hosts micros service.
I'm going to find local host right there.
We no longer want to make a request to local hosts.
Instead we want to make a request to post cluster IP SRB because that's how we get access to the post
pod once again.
I'll go to my terminal do a cube CTO get services and just verify the name.
Yep hosts cluster IP SRB at Port 4000 so post cluster IP as Savi still port four thousand go.
So I'll say this as well.
So we've now made changes to two of our micros services and we need to somehow now deploy those we spoke
about how we update deployments just a little bit ago.
So as a quick reminder see where's our diagram for it somewhere.
Here it is right here so we've made an update to our code.
If you want to deploy that we're going to rebuild the image or our event bus and propose will then push
those images to Docker Hub and then run the command QCT CTO blah blah blah with the deployment name
so we've updated our code.
Let's go and rebuild both those images again at my terminal all change back into my event bus directory
and do a docker build dash T.
Steven Greider event dash bus Dot.
Don't forget the dot at the end.
There's that.
I'll push that image though Docker push event bus
that'll take just a minute or two maybe I'll be really quick.
Let's see how long it takes.
Very good.
I'll go and do the same thing for post as well.
They'll go up one directory change into posts we'll do a docker build your Docker I.D. flash posts and
a dot at the very end.
And a docker push repos.
All right.
So now to make sure that we update both of our deployments we'll do the cube CTO rollout restart deployment
or our post deployment and the event plus deployment as well.
If we forget the name of those deployments we can raise you a QCT I'll get deployments so there's the
name of the two deployments that we need to restart.
So let's do the post one first.
They'll do a cube CDL rollout restart deployment
O's double UCL rollout restart event bus depot Oh restart deployment
there we go
all then list out all my pods and make sure that they both just got restarted so acute I'll get pods
Oh this is interesting you'll notice that I ran this command quickly enough to see the old pod that
was being executed for the event plus deployment it's now being terminated as being replaced with this
brand new one because we are trying to replace or re start or I should say yes replace the pod that
was already running I'll do another get pods it looks like that other one has now been fully terminated
and we've now got just these two pods well the last thing we need to do is a quick test so we're going
to open up postmen we're going to try to manually create a post by issuing a post request to our post
service or the post micros service and then we'll make sure that the event bus and posts are somehow
in communication by doing their logs and making sure that they are exchanging some events this video
is running a little bit long however.
So let's take care of that little test in just a moment.