In this episode, you will understand what the Service-to-Service invocation building block is, how it works, and how you can use it in your own applications.
📺 CSharp TV - Dev Streaming Destination http://csharp.tv
🌎 C# Corner - Community of Software and Data Developers https://www.c-sharpcorner.com
#CSharpTV #csharpcorner #Dapr #LiveShow
Show More Show Less View Video Transcript
0:00
[Music]
0:18
[Music]
0:32
hey people how are you this is Rodrigo
0:35
hey people how are you this is Rodrigo
0:35
hey people how are you this is Rodrigo your host and this is Dapper in
0:38
your host and this is Dapper in
0:38
your host and this is Dapper in action and today we're going to see the
0:44
action and today we're going to see the
0:44
action and today we're going to see the service to service invocation building
0:46
service to service invocation building
0:46
service to service invocation building block
0:48
block
0:48
block since there are sometimes when we need
0:51
since there are sometimes when we need
0:51
since there are sometimes when we need to communicate between services in an a
0:55
to communicate between services in an a
0:55
to communicate between services in an a synchronous way instead of asynchronous
1:00
synchronous way instead of asynchronous
1:00
synchronous way instead of asynchronous we can do it synchronously meaning that
1:02
we can do it synchronously meaning that
1:02
we can do it synchronously meaning that we send this request and we expect to
1:05
we send this request and we expect to
1:05
we send this request and we expect to receive a
1:07
receive a
1:07
receive a response and I think this is a common
1:11
response and I think this is a common
1:11
response and I think this is a common practice there's nothing wrong with
1:14
practice there's nothing wrong with
1:14
practice there's nothing wrong with communicating your microservices or
1:17
communicating your microservices or
1:17
communicating your microservices or components in a synchronous way okay of
1:21
components in a synchronous way okay of
1:21
components in a synchronous way okay of course there are some uh few drawbacks
1:25
course there are some uh few drawbacks
1:25
course there are some uh few drawbacks if you do that for instance there's
1:28
if you do that for instance there's
1:28
if you do that for instance there's temporal coupling between those to
1:31
temporal coupling between those to
1:31
temporal coupling between those to services but yeah I believe software
1:35
services but yeah I believe software
1:35
services but yeah I believe software architecture is all about tradeoffs and
1:38
architecture is all about tradeoffs and
1:38
architecture is all about tradeoffs and sometimes you have to communicate
1:40
sometimes you have to communicate
1:40
sometimes you have to communicate between those two
1:41
between those two
1:42
between those two services and that's why today we're
1:45
services and that's why today we're
1:45
services and that's why today we're going to see the service to service
1:46
going to see the service to service
1:46
going to see the service to service invocation building
1:48
invocation building
1:48
invocation building blog or service to service communication
1:51
blog or service to service communication
1:51
blog or service to service communication building
1:52
building
1:52
building blog also known as the service
1:55
blog also known as the service
1:55
blog also known as the service invocation building
1:57
invocation building
1:57
invocation building block so before
2:00
block so before
2:00
block so before we go ahead let me show you the thing
2:04
we go ahead let me show you the thing
2:04
we go ahead let me show you the thing that we did in the past in the other
2:07
that we did in the past in the other
2:07
that we did in the past in the other session when we were we were you know we
2:11
session when we were we were you know we
2:11
session when we were we were you know we were practicing with the pops up in uh
2:13
were practicing with the pops up in uh
2:13
were practicing with the pops up in uh building block and let me show
2:16
building block and let me show
2:17
building block and let me show you the code that I was
2:20
you the code that I was
2:20
you the code that I was building which is is this my visual
2:23
building which is is this my visual
2:23
building which is is this my visual studio instance is not this is the
2:27
studio instance is not this is the
2:27
studio instance is not this is the one so you might remember that I created
2:30
one so you might remember that I created
2:30
one so you might remember that I created my service a and my service B right
2:34
my service a and my service B right
2:34
my service a and my service B right and I was trying to send this
2:37
and I was trying to send this
2:37
and I was trying to send this message from service a to service B but
2:41
message from service a to service B but
2:41
message from service a to service B but of course service a doesn't know
2:44
of course service a doesn't know
2:44
of course service a doesn't know anything about service B right it
2:47
anything about service B right it
2:47
anything about service B right it doesn't know who's going to be the one
2:49
doesn't know who's going to be the one
2:49
doesn't know who's going to be the one that is going to receive the messages it
2:52
that is going to receive the messages it
2:52
that is going to receive the messages it could be service B service C Service D
2:55
could be service B service C Service D
2:55
could be service B service C Service D or all of
2:57
or all of
2:57
or all of them okay so so you might remember that
3:02
them okay so so you might remember that
3:02
them okay so so you might remember that I included saves controller and I'm
3:05
I included saves controller and I'm
3:05
I included saves controller and I'm using the dopper client object for
3:07
using the dopper client object for
3:07
using the dopper client object for sending this message by using the
3:09
sending this message by using the
3:09
sending this message by using the publish and acing Method and I'm using
3:12
publish and acing Method and I'm using
3:12
publish and acing Method and I'm using this name which is the name of the pop
3:15
this name which is the name of the pop
3:15
this name which is the name of the pop sub component as configured in my
3:19
sub component as configured in my
3:19
sub component as configured in my machine I'm using the um default
3:24
machine I'm using the um default
3:25
machine I'm using the um default configuration so let me expand my
3:28
configuration so let me expand my
3:28
configuration so let me expand my terminal you might remember that we have
3:31
terminal you might remember that we have
3:31
terminal you might remember that we have in
3:33
in
3:33
in your uh home folder right and then
3:36
your uh home folder right and then
3:36
your uh home folder right and then dopper and here inside components we can
3:40
dopper and here inside components we can
3:40
dopper and here inside components we can see there's a component named pops up
3:43
see there's a component named pops up
3:43
see there's a component named pops up and there's another one for um saving
3:46
and there's another one for um saving
3:46
and there's another one for um saving state that we're going to see in a
3:48
state that we're going to see in a
3:48
state that we're going to see in a following session however this component
3:52
following session however this component
3:52
following session however this component inside pops up. jaml which is of kind
3:56
inside pops up. jaml which is of kind
3:56
inside pops up. jaml which is of kind component this is the one that I'm using
3:58
component this is the one that I'm using
3:58
component this is the one that I'm using by default when I'm trying to
4:01
by default when I'm trying to
4:01
by default when I'm trying to communicate between those two Services
4:03
communicate between those two Services
4:03
communicate between those two Services okay this is just a reminder of the pops
4:07
okay this is just a reminder of the pops
4:07
okay this is just a reminder of the pops up thing that we did in the past the
4:09
up thing that we did in the past the
4:10
up thing that we did in the past the thing is that the name is pops up and
4:12
thing is that the name is pops up and
4:12
thing is that the name is pops up and that's why I'm using pops up here and
4:15
that's why I'm using pops up here and
4:15
that's why I'm using pops up here and then the name of the topic and you
4:17
then the name of the topic and you
4:17
then the name of the topic and you specify a payload and basically that's
4:21
specify a payload and basically that's
4:21
specify a payload and basically that's it that's it right you're sending this
4:25
it that's it right you're sending this
4:25
it that's it right you're sending this message with this particular payload to
4:28
message with this particular payload to
4:28
message with this particular payload to the middleware that is conf configured
4:31
the middleware that is conf configured
4:31
the middleware that is conf configured your message broker which is in this
4:34
your message broker which is in this
4:34
your message broker which is in this case
4:35
case
4:35
case redis uh that is running as a Docker
4:38
redis uh that is running as a Docker
4:38
redis uh that is running as a Docker container
4:39
container
4:39
container right so I can go ahead and type Docker
4:43
right so I can go ahead and type Docker
4:43
right so I can go ahead and type Docker PS and this is running you can see here
4:46
PS and this is running you can see here
4:46
PS and this is running you can see here red
4:47
red
4:47
red is so far so good right so far so good
4:52
is so far so good right so far so good
4:52
is so far so good right so far so good so the thing about this is that some
4:56
so the thing about this is that some
4:56
so the thing about this is that some code was missing here in the receiving
5:00
code was missing here in the receiving
5:00
code was missing here in the receiving part okay and here I'm using of course
5:05
part okay and here I'm using of course
5:05
part okay and here I'm using of course the dopper client as well which is not
5:08
the dopper client as well which is not
5:08
the dopper client as well which is not completely required I'm just showing you
5:12
completely required I'm just showing you
5:12
completely required I'm just showing you that I that you can inject dopper client
5:14
that I that you can inject dopper client
5:14
that I that you can inject dopper client everywhere and I'm using this topic
5:18
everywhere and I'm using this topic
5:18
everywhere and I'm using this topic attribute and this is the one that you
5:21
attribute and this is the one that you
5:21
attribute and this is the one that you can use for exposing an endpoint that is
5:24
can use for exposing an endpoint that is
5:24
can use for exposing an endpoint that is going to receive the message right so
5:27
going to receive the message right so
5:27
going to receive the message right so the first um so the first parameter is
5:30
the first um so the first parameter is
5:30
the first um so the first parameter is the name of the pops up component and
5:33
the name of the pops up component and
5:33
the name of the pops up component and then then the sales string specifies the
5:37
then then the sales string specifies the
5:37
then then the sales string specifies the topic name so I'm sending a message to
5:41
topic name so I'm sending a message to
5:41
topic name so I'm sending a message to sales and this one is receiving messages
5:44
sales and this one is receiving messages
5:44
sales and this one is receiving messages from
5:45
from
5:45
from sales right so far so good and speaking
5:49
sales right so far so good and speaking
5:49
sales right so far so good and speaking of
5:50
of
5:50
of program.cs in the receiving part you
5:53
program.cs in the receiving part you
5:53
program.cs in the receiving part you have to specify use cloud events and if
5:56
have to specify use cloud events and if
5:56
have to specify use cloud events and if you're going to use you this topic
5:58
you're going to use you this topic
5:59
you're going to use you this topic attribute
6:00
attribute
6:00
attribute you can use map subscribe
6:02
you can use map subscribe
6:02
you can use map subscribe Handler which is the way that you tell
6:06
Handler which is the way that you tell
6:06
Handler which is the way that you tell Dapper hey Dapper let's go ahead and
6:10
Dapper hey Dapper let's go ahead and
6:10
Dapper hey Dapper let's go ahead and find all of those methods that I have
6:14
find all of those methods that I have
6:14
find all of those methods that I have that are able to receive
6:17
that are able to receive
6:17
that are able to receive messages okay those two lines 21 and 22
6:22
messages okay those two lines 21 and 22
6:22
messages okay those two lines 21 and 22 are the responsibles for receiving the
6:25
are the responsibles for receiving the
6:25
are the responsibles for receiving the message and I show you how you can
6:30
message and I show you how you can
6:31
message and I show you how you can um is this R is Commander I showed you
6:34
um is this R is Commander I showed you
6:34
um is this R is Commander I showed you that you can use something like RIS
6:36
that you can use something like RIS
6:36
that you can use something like RIS Commander
6:39
Commander
6:39
Commander for
6:41
for
6:41
for inspecting the um the middleware in this
6:45
inspecting the um the middleware in this
6:45
inspecting the um the middleware in this case redit right this is a this is a
6:48
case redit right this is a this is a
6:48
case redit right this is a this is a tool that we use
6:50
tool that we use
6:50
tool that we use for inspecting and connecting to Reddit
6:54
for inspecting and connecting to Reddit
6:54
for inspecting and connecting to Reddit and you know U taking a look at those
6:57
and you know U taking a look at those
6:57
and you know U taking a look at those messages that we have so in this case I
7:00
messages that we have so in this case I
7:00
messages that we have so in this case I sent two
7:02
sent two
7:02
sent two messages those two messages are inside
7:05
messages those two messages are inside
7:05
messages those two messages are inside this sales topic and everything is
7:08
this sales topic and everything is
7:08
this sales topic and everything is working as expected okay now you need to
7:11
working as expected okay now you need to
7:12
working as expected okay now you need to run of course the receiving part so you
7:16
run of course the receiving part so you
7:16
run of course the receiving part so you can go to the let's go here and pops up
7:21
can go to the let's go here and pops up
7:21
can go to the let's go here and pops up and then my service be and here I can
7:25
and then my service be and here I can
7:25
and then my service be and here I can you know use dopper Ron and then dopper
7:29
you know use dopper Ron and then dopper
7:29
you know use dopper Ron and then dopper HTTP port and then Pass
7:34
HTTP port and then Pass
7:34
HTTP port and then Pass netron and Pass the required parameters
7:38
netron and Pass the required parameters
7:39
netron and Pass the required parameters okay so this is this is the missing part
7:42
okay so this is this is the missing part
7:42
okay so this is this is the missing part from last session this topic
7:45
from last session this topic
7:45
from last session this topic attribute
7:47
attribute
7:47
attribute and with this you can receive those
7:50
and with this you can receive those
7:50
and with this you can receive those messages okay
7:52
messages okay
7:52
messages okay perfect now let's go ahead and Jump
7:57
perfect now let's go ahead and Jump
7:57
perfect now let's go ahead and Jump Right In into the Servicing location
8:01
Right In into the Servicing location
8:01
Right In into the Servicing location topic which is you know as I mentioned
8:04
topic which is you know as I mentioned
8:04
topic which is you know as I mentioned before is the way that we use for
8:06
before is the way that we use for
8:06
before is the way that we use for communicating between services in a
8:08
communicating between services in a
8:08
communicating between services in a direct way because sometimes you have to
8:11
direct way because sometimes you have to
8:11
direct way because sometimes you have to do that don't over engineer your
8:14
do that don't over engineer your
8:15
do that don't over engineer your Solutions my friends okay so sometimes
8:19
Solutions my friends okay so sometimes
8:19
Solutions my friends okay so sometimes communicating between services in a
8:21
communicating between services in a
8:21
communicating between services in a synchronous way is perfectly valid don't
8:24
synchronous way is perfectly valid don't
8:24
synchronous way is perfectly valid don't be afraid of doing this
8:27
be afraid of doing this
8:27
be afraid of doing this okay okay let's let's go ahead and see
8:30
okay okay let's let's go ahead and see
8:30
okay okay let's let's go ahead and see what's going on here let's say that you
8:33
what's going on here let's say that you
8:33
what's going on here let's say that you need to communicate between service a to
8:35
need to communicate between service a to
8:35
need to communicate between service a to service b in a synchronous way how do
8:38
service b in a synchronous way how do
8:38
service b in a synchronous way how do you do that without
8:41
you do that without
8:41
you do that without Dapper right how do you how you how do
8:45
Dapper right how do you how you how do
8:45
Dapper right how do you how you how do you do that today without
8:47
you do that today without
8:48
you do that today without Dapper so sometimes you do something
8:52
Dapper so sometimes you do something
8:52
Dapper so sometimes you do something like if you're using C right um let's
8:55
like if you're using C right um let's
8:55
like if you're using C right um let's say bar HTTP client equals new new HTTP
9:00
say bar HTTP client equals new new HTTP
9:00
say bar HTTP client equals new new HTTP client and then pass the URL right just
9:04
client and then pass the URL right just
9:04
client and then pass the URL right just like this and then HTTP client get
9:07
like this and then HTTP client get
9:08
like this and then HTTP client get string Asing or
9:10
string Asing or
9:10
string Asing or post Asing or whatever floats your boat
9:15
post Asing or whatever floats your boat
9:15
post Asing or whatever floats your boat right
9:17
right
9:17
right however what in the world is URL what's
9:20
however what in the world is URL what's
9:20
however what in the world is URL what's the value of URL meaning that service V
9:24
the value of URL meaning that service V
9:24
the value of URL meaning that service V can have multiple
9:27
can have multiple
9:27
can have multiple replicas so service B could have I don't
9:30
replicas so service B could have I don't
9:31
replicas so service B could have I don't know three replicas five
9:33
know three replicas five
9:33
know three replicas five replicas 10 replicas who
9:37
replicas 10 replicas who
9:37
replicas 10 replicas who knows so if you do this of course we can
9:41
knows so if you do this of course we can
9:41
knows so if you do this of course we can if you are net developer we can discuss
9:43
if you are net developer we can discuss
9:44
if you are net developer we can discuss if this is the best way of course you
9:45
if this is the best way of course you
9:45
if this is the best way of course you can inject the HTTP client Factory
9:49
can inject the HTTP client Factory
9:49
can inject the HTTP client Factory interface and so on I'm not discussing
9:52
interface and so on I'm not discussing
9:52
interface and so on I'm not discussing HTTP client best practices right now
9:55
HTTP client best practices right now
9:55
HTTP client best practices right now just imagine that you need to
9:57
just imagine that you need to
9:57
just imagine that you need to communicate between those two services
10:00
communicate between those two services
10:00
communicate between those two services and service B has many replicas how do
10:02
and service B has many replicas how do
10:02
and service B has many replicas how do you do this what's URL this is a problem
10:06
you do this what's URL this is a problem
10:06
you do this what's URL this is a problem right because you need a way to
10:10
right because you need a way to
10:10
right because you need a way to identify those URLs those IP addresses
10:15
identify those URLs those IP addresses
10:15
identify those URLs those IP addresses and ports which is not uh quite easy to
10:19
and ports which is not uh quite easy to
10:19
and ports which is not uh quite easy to do to be honest with you so this is how
10:23
do to be honest with you so this is how
10:23
do to be honest with you so this is how we can do this without Dapper and with
10:26
we can do this without Dapper and with
10:26
we can do this without Dapper and with Dapper we use the side card of course
10:29
Dapper we use the side card of course
10:29
Dapper we use the side card of course you you you you remember that Dapper
10:32
you you you you remember that Dapper
10:32
you you you you remember that Dapper runs as a side car is a design pattern
10:36
runs as a side car is a design pattern
10:36
runs as a side car is a design pattern right it's running alongside your main
10:39
right it's running alongside your main
10:39
right it's running alongside your main application so at the end of the day
10:41
application so at the end of the day
10:41
application so at the end of the day each service has a dber side car so
10:45
each service has a dber side car so
10:45
each service has a dber side car so that's why you use the side cars for
10:48
that's why you use the side cars for
10:48
that's why you use the side cars for communicating
10:50
communicating
10:50
communicating directly in other words you don't
10:52
directly in other words you don't
10:52
directly in other words you don't communicate between service a and
10:53
communicate between service a and
10:53
communicate between service a and service B you say to your own dopper
10:57
service B you say to your own dopper
10:57
service B you say to your own dopper side car hey dopper I want to
11:00
side car hey dopper I want to
11:00
side car hey dopper I want to communicate to service B go and do that
11:05
communicate to service B go and do that
11:05
communicate to service B go and do that okay they commanding the dopper side car
11:08
okay they commanding the dopper side car
11:08
okay they commanding the dopper side car to do it for you so you send this
11:12
to do it for you so you send this
11:12
to do it for you so you send this message to the dopper side car and the
11:16
message to the dopper side car and the
11:16
message to the dopper side car and the dopper side card is going to use a name
11:18
dopper side card is going to use a name
11:18
dopper side card is going to use a name resolution component that is configured
11:22
resolution component that is configured
11:22
resolution component that is configured when you initialize
11:24
when you initialize
11:24
when you initialize Dapper if you're running on a
11:26
Dapper if you're running on a
11:26
Dapper if you're running on a self-hosted mode in this case is going
11:29
self-hosted mode in this case is going
11:29
self-hosted mode in this case is going to use um the local
11:35
to use um the local
11:35
to use um the local um um DNS service that your machine has
11:39
um um DNS service that your machine has
11:39
um um DNS service that your machine has and if you're running in kubernetes it's
11:41
and if you're running in kubernetes it's
11:41
and if you're running in kubernetes it's going to use kubernetes DNS I'm going to
11:43
going to use kubernetes DNS I'm going to
11:43
going to use kubernetes DNS I'm going to talk about a little bit later about
11:45
talk about a little bit later about
11:45
talk about a little bit later about about that okay so the thing is that you
11:48
about that okay so the thing is that you
11:48
about that okay so the thing is that you need this name resolution service or
11:52
need this name resolution service or
11:52
need this name resolution service or component
11:54
component
11:54
component responsible
11:56
responsible
11:56
responsible for uh telling you hey you know what
11:58
for uh telling you hey you know what
11:58
for uh telling you hey you know what service B is running in this uh address
12:03
service B is running in this uh address
12:03
service B is running in this uh address and Port okay this is the
12:06
and Port okay this is the
12:06
and Port okay this is the responsible
12:07
responsible
12:07
responsible so then you send or not you but the
12:12
so then you send or not you but the
12:12
so then you send or not you but the dopper side car sends a message and um
12:17
dopper side car sends a message and um
12:17
dopper side car sends a message and um sends this request to this other dopper
12:20
sends this request to this other dopper
12:20
sends this request to this other dopper side car the one from service B okay so
12:26
side car the one from service B okay so
12:26
side car the one from service B okay so you can see here that the dopper
12:28
you can see here that the dopper
12:28
you can see here that the dopper communication happen s in
12:30
communication happen s in
12:30
communication happen s in grpc it's going to use this technology
12:33
grpc it's going to use this technology
12:33
grpc it's going to use this technology for performance reasons I mean between
12:36
for performance reasons I mean between
12:36
for performance reasons I mean between those two dopper side cars grpc is the
12:39
those two dopper side cars grpc is the
12:39
those two dopper side cars grpc is the technology that is going to be used and
12:42
technology that is going to be used and
12:42
technology that is going to be used and it's going to use mtls Mutual Tas for
12:48
it's going to use mtls Mutual Tas for
12:48
it's going to use mtls Mutual Tas for um um for uh data security between those
12:52
um um for uh data security between those
12:52
um um for uh data security between those two uh doer side car instances and then
12:56
two uh doer side car instances and then
12:56
two uh doer side car instances and then it's going to send the request to the
12:58
it's going to send the request to the
12:58
it's going to send the request to the service V
12:59
service V
12:59
service V service B receives the
13:03
service B receives the
13:03
service B receives the request in other words receives the you
13:06
request in other words receives the you
13:06
request in other words receives the you know the yes the request the the
13:09
know the yes the request the the
13:09
know the yes the request the the intention the the the thing that you you
13:11
intention the the the thing that you you
13:11
intention the the the thing that you you w to invoke from service B and then
13:14
w to invoke from service B and then
13:14
w to invoke from service B and then service B invokes the thing and it's
13:17
service B invokes the thing and it's
13:17
service B invokes the thing and it's gonna send the request I'm sorry the
13:20
gonna send the request I'm sorry the
13:20
gonna send the request I'm sorry the response back to service service a okay
13:25
response back to service service a okay
13:25
response back to service service a okay so you can see that some other parts are
13:28
so you can see that some other parts are
13:28
so you can see that some other parts are involved it's not as
13:30
involved it's not as
13:30
involved it's not as easy as just you know service a to
13:33
easy as just you know service a to
13:33
easy as just you know service a to service B the doer side cards are
13:35
service B the doer side cards are
13:35
service B the doer side cards are involved and the name resolution service
13:37
involved and the name resolution service
13:37
involved and the name resolution service is uh um involved here as
13:41
is uh um involved here as
13:41
is uh um involved here as well so what are some features about
13:44
well so what are some features about
13:44
well so what are some features about this platform about the service
13:47
this platform about the service
13:47
this platform about the service invocation building block the first one
13:50
invocation building block the first one
13:50
invocation building block the first one is that you can swap that service
13:53
is that you can swap that service
13:53
is that you can swap that service Discovery component this one the name
13:56
Discovery component this one the name
13:56
Discovery component this one the name resolution service or component or
13:59
resolution service or component or
13:59
resolution service or component or platform you can change it
14:02
platform you can change it
14:02
platform you can change it okay uh for instance you might you may
14:05
okay uh for instance you might you may
14:05
okay uh for instance you might you may want to use I don't know I don't know
14:08
want to use I don't know I don't know
14:08
want to use I don't know I don't know you can use um console you can use
14:11
you can use um console you can use
14:11
you can use um console you can use sqlite those two concrete
14:13
sqlite those two concrete
14:13
sqlite those two concrete implementations are available right now
14:17
implementations are available right now
14:17
implementations are available right now uh so console hash corpse console is uh
14:21
uh so console hash corpse console is uh
14:21
uh so console hash corpse console is uh quite popular
14:22
quite popular
14:22
quite popular technology and it's actually the main
14:24
technology and it's actually the main
14:25
technology and it's actually the main goal about console is doing this right a
14:27
goal about console is doing this right a
14:27
goal about console is doing this right a service discovery
14:29
service discovery
14:29
service discovery platform uh
14:31
platform uh
14:31
platform uh highly uh available for distributed
14:36
highly uh available for distributed
14:36
highly uh available for distributed applications the other feature is
14:38
applications the other feature is
14:38
applications the other feature is resiliency because what can happen if uh
14:42
resiliency because what can happen if uh
14:42
resiliency because what can happen if uh you know service
14:44
you know service
14:44
you know service be um goes
14:47
be um goes
14:47
be um goes down what what happens in that case can
14:50
down what what happens in that case can
14:51
down what what happens in that case can you imagine can you imagine that in your
14:54
you imagine can you imagine that in your
14:54
you imagine can you imagine that in your Solutions you have something like this
14:57
Solutions you have something like this
14:57
Solutions you have something like this and service B um throws an exception or
15:02
and service B um throws an exception or
15:02
and service B um throws an exception or goes down or not even the service be but
15:06
goes down or not even the service be but
15:06
goes down or not even the service be but the I don't know the the server that is
15:09
the I don't know the the server that is
15:09
the I don't know the the server that is hosting service B what happens so
15:12
hosting service B what happens so
15:12
hosting service B what happens so luckily we have the resiliency feature
15:15
luckily we have the resiliency feature
15:16
luckily we have the resiliency feature baked in into the service invocation
15:18
baked in into the service invocation
15:18
baked in into the service invocation building block so you can specify some
15:22
building block so you can specify some
15:22
building block so you can specify some policies for resiliency such as
15:25
policies for resiliency such as
15:25
policies for resiliency such as automatic retries with back of time
15:28
automatic retries with back of time
15:28
automatic retries with back of time periods or timeout and so on and so on
15:31
periods or timeout and so on and so on
15:31
periods or timeout and so on and so on I'm going to talk about about that in a
15:33
I'm going to talk about about that in a
15:33
I'm going to talk about about that in a little
15:35
little
15:35
little bit the other feature is tracing the
15:39
bit the other feature is tracing the
15:39
bit the other feature is tracing the Matrix so all calls are uh traced into
15:44
Matrix so all calls are uh traced into
15:44
Matrix so all calls are uh traced into the
15:45
the
15:45
the configured uh tracing platform that you
15:48
configured uh tracing platform that you
15:48
configured uh tracing platform that you have in place you can configure your
15:52
have in place you can configure your
15:52
have in place you can configure your tracing uh Target meaning you can use
15:57
tracing uh Target meaning you can use
15:57
tracing uh Target meaning you can use Zipkin you can use New Relic you can use
16:01
Zipkin you can use New Relic you can use
16:01
Zipkin you can use New Relic you can use Jagger you can use whatever floats your
16:03
Jagger you can use whatever floats your
16:03
Jagger you can use whatever floats your boat and all calls are traced and also
16:08
boat and all calls are traced and also
16:08
boat and all calls are traced and also metrics are are uh stored in that um in
16:12
metrics are are uh stored in that um in
16:12
metrics are are uh stored in that um in that particular platform which is
16:15
that particular platform which is
16:15
that particular platform which is fantastic because I believe that's one
16:17
fantastic because I believe that's one
16:17
fantastic because I believe that's one of the things that we uh software
16:20
of the things that we uh software
16:20
of the things that we uh software Architects and developers we
16:23
Architects and developers we
16:23
Architects and developers we forget most of the time you
16:26
forget most of the time you
16:26
forget most of the time you know um I
16:29
know um I
16:29
know um I wish it wasn't true but it's true uh
16:33
wish it wasn't true but it's true uh
16:33
wish it wasn't true but it's true uh sometimes we totally forget about
16:35
sometimes we totally forget about
16:35
sometimes we totally forget about tracing and metric and
16:39
tracing and metric and
16:39
tracing and metric and observability uh components for our
16:41
observability uh components for our
16:42
observability uh components for our applications so this is great and mutual
16:45
applications so this is great and mutual
16:45
applications so this is great and mutual TLS as I mentioned
16:47
TLS as I mentioned
16:47
TLS as I mentioned before the communication between those
16:49
before the communication between those
16:49
before the communication between those two components happens by using Mutual
16:53
two components happens by using Mutual
16:53
two components happens by using Mutual TLS um so this is a
16:56
TLS um so this is a
16:56
TLS um so this is a secure uh communication between those
16:59
secure uh communication between those
16:59
secure uh communication between those two microservices and finally you can
17:01
two microservices and finally you can
17:01
two microservices and finally you can also use Access Control policies for
17:05
also use Access Control policies for
17:05
also use Access Control policies for specifying uh you know who can
17:10
specifying uh you know who can
17:10
specifying uh you know who can invoke which method in your Solutions
17:14
invoke which method in your Solutions
17:14
invoke which method in your Solutions okay it's not that you open everything
17:16
okay it's not that you open everything
17:16
okay it's not that you open everything and all of a sudden everything is open
17:19
and all of a sudden everything is open
17:19
and all of a sudden everything is open of course you can do that uh but you can
17:23
of course you can do that uh but you can
17:23
of course you can do that uh but you can also have this granular control over who
17:27
also have this granular control over who
17:27
also have this granular control over who and what access
17:29
and what access
17:29
and what access those uh methods and and and
17:32
those uh methods and and and
17:32
those uh methods and and and services this is marvelous right this is
17:37
services this is marvelous right this is
17:37
services this is marvelous right this is fantastic because as you can see and as
17:40
fantastic because as you can see and as
17:40
fantastic because as you can see and as you can hear service invocation has
17:44
you can hear service invocation has
17:44
you can hear service invocation has those things that we have to implement
17:47
those things that we have to implement
17:47
those things that we have to implement ourselves without using something like
17:51
ourselves without using something like
17:51
ourselves without using something like Dapper So speaking a little bit more
17:54
Dapper So speaking a little bit more
17:54
Dapper So speaking a little bit more about the name resolution service you
17:56
about the name resolution service you
17:57
about the name resolution service you know the service Discovery thing
17:59
know the service Discovery thing
17:59
know the service Discovery thing uh if you use the selfhosted modee just
18:03
uh if you use the selfhosted modee just
18:03
uh if you use the selfhosted modee just like I do in this uh drer in action um
18:08
like I do in this uh drer in action um
18:08
like I do in this uh drer in action um um
18:09
um
18:09
um webinars I'm using the multicast DNS
18:13
webinars I'm using the multicast DNS
18:13
webinars I'm using the multicast DNS component that is inside my Windows
18:17
component that is inside my Windows
18:17
component that is inside my Windows operating system so you don't need to do
18:21
operating system so you don't need to do
18:21
operating system so you don't need to do uh anything else to make it work it just
18:25
uh anything else to make it work it just
18:25
uh anything else to make it work it just works
18:26
works
18:26
works okay and if you wrun running Dapper
18:29
okay and if you wrun running Dapper
18:29
okay and if you wrun running Dapper inside kubernetes then it's going to use
18:32
inside kubernetes then it's going to use
18:32
inside kubernetes then it's going to use kubernetes DNS by default and also you
18:36
kubernetes DNS by default and also you
18:36
kubernetes DNS by default and also you don't need to configure anything else it
18:38
don't need to configure anything else it
18:38
don't need to configure anything else it just works out of the
18:41
just works out of the
18:41
just works out of the box which is fantastic right so those
18:45
box which is fantastic right so those
18:46
box which is fantastic right so those two are the default implementations of
18:48
two are the default implementations of
18:48
two are the default implementations of the DNS service that is going to uh give
18:52
the DNS service that is going to uh give
18:52
the DNS service that is going to uh give you the correct IP addresses and ports
18:56
you the correct IP addresses and ports
18:56
you the correct IP addresses and ports of those Target services
18:59
of those Target services
18:59
of those Target services speaking about resiliency as I was
19:03
speaking about resiliency as I was
19:03
speaking about resiliency as I was mentioning before um you can apply
19:07
mentioning before um you can apply
19:07
mentioning before um you can apply resiliency policies okay there's a
19:10
resiliency policies okay there's a
19:11
resiliency policies okay there's a resiliency object that you have to
19:14
resiliency object that you have to
19:14
resiliency object that you have to specify inside a um jam file in the
19:18
specify inside a um jam file in the
19:18
specify inside a um jam file in the self-hosted mode the name should be
19:20
self-hosted mode the name should be
19:20
self-hosted mode the name should be resiliency
19:21
resiliency
19:21
resiliency dojo and if you're running on kubernetes
19:25
dojo and if you're running on kubernetes
19:25
dojo and if you're running on kubernetes then Dapper is going to find the
19:27
then Dapper is going to find the
19:27
then Dapper is going to find the name um resilency specs used by the
19:31
name um resilency specs used by the
19:31
name um resilency specs used by the applications and as I was mentioning
19:33
applications and as I was mentioning
19:34
applications and as I was mentioning before there are some patterns that you
19:35
before there are some patterns that you
19:35
before there are some patterns that you can Implement right such as timeouts
19:38
can Implement right such as timeouts
19:38
can Implement right such as timeouts retries with backups and circuit
19:40
retries with backups and circuit
19:40
retries with backups and circuit breakers and so
19:42
breakers and so
19:42
breakers and so on and actually um I'm going to show you
19:46
on and actually um I'm going to show you
19:46
on and actually um I'm going to show you the documentation about the
19:49
the documentation about the
19:49
the documentation about the resiliency uh schema so we can uh create
19:54
resiliency uh schema so we can uh create
19:54
resiliency uh schema so we can uh create our own resiliency doj file and test
19:58
our own resiliency doj file and test
19:58
our own resiliency doj file and test this out okay so the if you want to
20:02
this out okay so the if you want to
20:03
this out okay so the if you want to remember Dapper is exposing this API and
20:05
remember Dapper is exposing this API and
20:05
remember Dapper is exposing this API and if you want to
20:08
if you want to
20:08
if you want to execute uh or use the service
20:10
execute uh or use the service
20:11
execute uh or use the service implication building block this is the
20:14
implication building block this is the
20:14
implication building block this is the end point okay
20:16
end point okay
20:16
end point okay v1.0 invoke and then you pass the name
20:19
v1.0 invoke and then you pass the name
20:19
v1.0 invoke and then you pass the name of the application and then the name of
20:21
of the application and then the name of
20:21
of the application and then the name of the method that you want to execute I
20:23
the method that you want to execute I
20:23
the method that you want to execute I don't think
20:25
don't think
20:25
don't think that's uh a compelling way of using
20:28
that's uh a compelling way of using
20:28
that's uh a compelling way of using dapper
20:30
dapper
20:30
dapper uh remember that we're using the dopper
20:33
uh remember that we're using the dopper
20:33
uh remember that we're using the dopper SDK and I think that's a way to go of
20:37
SDK and I think that's a way to go of
20:37
SDK and I think that's a way to go of course it
20:38
course it
20:38
course it depends on the availability of an SDK
20:42
depends on the availability of an SDK
20:42
depends on the availability of an SDK for your
20:45
for your
20:45
for your um uh your development
20:48
um uh your development
20:48
um uh your development platform okay so far so good let me
20:52
platform okay so far so good let me
20:52
platform okay so far so good let me change the window
20:55
change the window
20:55
change the window [Music]
20:56
[Music]
20:56
[Music] to this um
20:59
to this um
20:59
to this um displays so this was running R is
21:02
displays so this was running R is
21:02
displays so this was running R is Commander let me change the path to
21:05
Commander let me change the path to
21:05
Commander let me change the path to doering
21:07
doering
21:07
doering action because I happen to have this
21:10
action because I happen to have this
21:10
action because I happen to have this couple of projects that I
21:13
couple of projects that I
21:13
couple of projects that I created half an hour
21:16
created half an hour
21:16
created half an hour ago um so those two were created by
21:19
ago um so those two were created by
21:19
ago um so those two were created by using net new web API and that's it okay
21:24
using net new web API and that's it okay
21:24
using net new web API and that's it okay that is it service a service B those two
21:28
that is it service a service B those two
21:28
that is it service a service B those two are inside the same
21:31
are inside the same
21:31
are inside the same solution so I'm going to open up visual
21:34
solution so I'm going to open up visual
21:34
solution so I'm going to open up visual studio please hold on I'm going to open
21:39
studio please hold on I'm going to open
21:39
studio please hold on I'm going to open that same solution
21:42
that same solution
21:42
that same solution here and I'm using this second Monitor
21:45
here and I'm using this second Monitor
21:45
here and I'm using this second Monitor and it's ready to go this is it okay so
21:50
and it's ready to go this is it okay so
21:50
and it's ready to go this is it okay so let's see how we can use the service
21:54
let's see how we can use the service
21:54
let's see how we can use the service invocation building
21:56
invocation building
21:56
invocation building block let's say that service B has I
22:00
block let's say that service B has I
22:00
block let's say that service B has I don't know it always has weather
22:03
don't know it always has weather
22:03
don't know it always has weather forecast it's so cheesy right weather
22:06
forecast it's so cheesy right weather
22:06
forecast it's so cheesy right weather forast anyway I think we we can use that
22:10
forast anyway I think we we can use that
22:10
forast anyway I think we we can use that I think we
22:11
I think we
22:11
I think we can we can totally reuse WEA forecast
22:16
can we can totally reuse WEA forecast
22:16
can we can totally reuse WEA forecast since I don't want to add some
22:18
since I don't want to add some
22:19
since I don't want to add some additional logic I just want to you know
22:22
additional logic I just want to you know
22:22
additional logic I just want to you know invoke this weather get weather
22:25
invoke this weather get weather
22:25
invoke this weather get weather forecast um endpoint
22:28
forecast um endpoint
22:28
forecast um endpoint so let me
22:30
so let me
22:30
so let me see uh service B J Ron so this is going
22:35
see uh service B J Ron so this is going
22:35
see uh service B J Ron so this is going to build the solution and then it's
22:37
to build the solution and then it's
22:37
to build the solution and then it's going
22:38
going
22:38
going to expose this
22:41
to expose this
22:41
to expose this endpoint right
22:44
endpoint right
22:44
endpoint right and here I can say is that get weather
22:49
and here I can say is that get weather
22:49
and here I can say is that get weather forecast is that the
22:52
forecast is that the
22:52
forecast is that the name uh weather
22:55
name uh weather
22:55
name uh weather forecast so weather for forecast forward
22:59
forecast so weather for forecast forward
22:59
forecast so weather for forecast forward SLG get weather
23:02
SLG get weather
23:02
SLG get weather forecast am I missing something service
23:05
forecast am I missing something service
23:05
forecast am I missing something service B weather
23:07
B weather
23:07
B weather forecast controller
23:10
forecast controller
23:10
forecast controller rout H weather forecast whe weather
23:14
rout H weather forecast whe weather
23:14
rout H weather forecast whe weather weather forecast am I missing something
23:17
weather forecast am I missing something
23:17
weather forecast am I missing something anyway I'm GNA use this maybe I'm not
23:20
anyway I'm GNA use this maybe I'm not
23:20
anyway I'm GNA use this maybe I'm not running the application
23:23
running the application
23:23
running the application correctly service to service service B
23:25
correctly service to service service B
23:25
correctly service to service service B dper in action Local Host is this the
23:29
dper in action Local Host is this the
23:29
dper in action Local Host is this the correct yeah I think this is it get
23:32
correct yeah I think this is it get
23:32
correct yeah I think this is it get weather weather
23:34
weather weather
23:34
weather weather forecast something is wrong with my URL
23:37
forecast something is wrong with my URL
23:38
forecast something is wrong with my URL anyway I don't want to maybe the answer
23:40
anyway I don't want to maybe the answer
23:40
anyway I don't want to maybe the answer will come up in a little bit the thing
23:44
will come up in a little bit the thing
23:44
will come up in a little bit the thing is that now I want
23:46
is that now I want
23:46
is that now I want to add Dapper ASP net core remember this
23:52
to add Dapper ASP net core remember this
23:52
to add Dapper ASP net core remember this is the SDK browse dopper ASP asp.net
23:57
is the SDK browse dopper ASP asp.net
23:57
is the SDK browse dopper ASP asp.net core
23:59
core
23:59
core nowadays the latest version of dapper is
24:03
nowadays the latest version of dapper is
24:03
nowadays the latest version of dapper is 1.44 but I think in a couple of weeks we
24:06
1.44 but I think in a couple of weeks we
24:06
1.44 but I think in a couple of weeks we can have
24:09
can have
24:09
can have 1.15 anyway so here let's
24:14
1.15 anyway so here let's
24:14
1.15 anyway so here let's see
24:15
see
24:16
see um I want to add let's change
24:21
um I want to add let's change
24:21
um I want to add let's change uh this name to query controller query
24:25
uh this name to query controller query
24:25
uh this name to query controller query controller okay and let's delete
24:30
everything this way right so HTTP
24:36
everything this way right so HTTP
24:36
everything this way right so HTTP get query and here I want to invoke
24:42
get query and here I want to invoke
24:42
get query and here I want to invoke invoke service B this is what I want to
24:45
invoke service B this is what I want to
24:45
invoke service B this is what I want to do
24:46
do
24:46
do okay so I'm going to use the dopper
24:48
okay so I'm going to use the dopper
24:48
okay so I'm going to use the dopper client object that's why I'm going to
24:50
client object that's why I'm going to
24:50
client object that's why I'm going to use the primary Constructor dopper
24:52
use the primary Constructor dopper
24:52
use the primary Constructor dopper client dopper client and here I want to
24:57
client dopper client and here I want to
24:57
client dopper client and here I want to use dopper client
24:59
use dopper client
24:59
use dopper client okay so thankfully to this
25:02
okay so thankfully to this
25:02
okay so thankfully to this SDK we can use invoke method async just
25:08
SDK we can use invoke method async just
25:08
SDK we can use invoke method async just like you're watching here inoke method
25:10
like you're watching here inoke method
25:10
like you're watching here inoke method async we have a couple of
25:13
async we have a couple of
25:13
async we have a couple of options the one that is uh the the
25:17
options the one that is uh the the
25:17
options the one that is uh the the regular one and the other that is a
25:20
regular one and the other that is a
25:20
regular one and the other that is a generic version of invol method
25:23
generic version of invol method
25:23
generic version of invol method async okay so you pass the payload that
25:28
async okay so you pass the payload that
25:28
async okay so you pass the payload that you're
25:29
you're
25:29
you're expecting to
25:30
expecting to
25:30
expecting to receive so in this case I'm expecting to
25:33
receive so in this case I'm expecting to
25:33
receive so in this case I'm expecting to receive whether
25:35
receive whether
25:35
receive whether forecast right because this is a
25:38
forecast right because this is a
25:38
forecast right because this is a actually an i inumerable of weather
25:40
actually an i inumerable of weather
25:40
actually an i inumerable of weather forecast this is the the the the object
25:44
forecast this is the the the the object
25:44
forecast this is the the the the object that this service is
25:48
that this service is
25:48
that this service is returning
25:49
returning
25:49
returning right very easy thing to grasp let's go
25:53
right very easy thing to grasp let's go
25:53
right very easy thing to grasp let's go here and I enumerable of weather
25:57
here and I enumerable of weather
25:57
here and I enumerable of weather forecast weather forecast of course I'm
26:01
forecast weather forecast of course I'm
26:01
forecast weather forecast of course I'm kind of reusing the existing classes
26:04
kind of reusing the existing classes
26:05
kind of reusing the existing classes here since I'm reusing weather forecast
26:08
here since I'm reusing weather forecast
26:08
here since I'm reusing weather forecast I I don't want to create another you
26:10
I I don't want to create another you
26:10
I I don't want to create another you know model class or I don't want to
26:13
know model class or I don't want to
26:13
know model class or I don't want to create a domain model or something
26:15
create a domain model or something
26:15
create a domain model or something because we don't have time today to do
26:18
because we don't have time today to do
26:18
because we don't have time today to do that I'm sorry
26:21
that I'm sorry
26:21
that I'm sorry and oh I'm choking here and luckily with
26:25
and oh I'm choking here and luckily with
26:25
and oh I'm choking here and luckily with a forecast this has the same structure
26:27
a forecast this has the same structure
26:27
a forecast this has the same structure as this other class right because it
26:30
as this other class right because it
26:30
as this other class right because it comes from the template so that is it I
26:35
comes from the template so that is it I
26:35
comes from the template so that is it I think that is it of course we need to
26:37
think that is it of course we need to
26:37
think that is it of course we need to change temperature let's make it get set
26:40
change temperature let's make it get set
26:40
change temperature let's make it get set because uh in the traditional
26:42
because uh in the traditional
26:43
because uh in the traditional temperature in
26:45
temperature in
26:45
temperature in fahrenheit uh it's uh just using this
26:49
fahrenheit uh it's uh just using this
26:49
fahrenheit uh it's uh just using this right so let's say that we have this
26:52
right so let's say that we have this
26:52
right so let's say that we have this model class and I want to reuse this and
26:55
model class and I want to reuse this and
26:55
model class and I want to reuse this and here you need to specify the application
26:57
here you need to specify the application
26:57
here you need to specify the application ID name name say service B and then the
27:02
ID name name say service B and then the
27:02
ID name name say service B and then the method name the method name is going to
27:05
method name the method name is going to
27:05
method name the method name is going to be let's see it's going to
27:09
be let's see it's going to
27:09
be let's see it's going to be uh get I think that is it right or
27:15
be uh get I think that is it right or
27:15
be uh get I think that is it right or get weather forecast let me go ahead and
27:19
get weather forecast let me go ahead and
27:19
get weather forecast let me go ahead and change
27:20
change
27:20
change this uh and let's go and fix this
27:27
this uh and let's go and fix this
27:27
this uh and let's go and fix this because so otherwise I'm going to have
27:29
because so otherwise I'm going to have
27:29
because so otherwise I'm going to have some
27:31
some
27:31
some problems so let me go back to the
27:34
problems so let me go back to the
27:34
problems so let me go back to the terminal and do this net build and I
27:38
terminal and do this net build and I
27:38
terminal and do this net build and I removed the HTTP gets string so net
27:44
removed the HTTP gets string so net
27:44
removed the HTTP gets string so net one I wanted to run on get get weather
27:47
one I wanted to run on get get weather
27:47
one I wanted to run on get get weather forecast and that's it this is my goal
27:49
forecast and that's it this is my goal
27:50
forecast and that's it this is my goal right now so this is running and
27:54
right now so this is running and
27:54
right now so this is running and weather forecast this is it right
27:59
weather forecast this is it right
27:59
weather forecast this is it right it's
28:00
it's
28:00
it's working so this is the name of the
28:02
working so this is the name of the
28:02
working so this is the name of the method that I want to invoke from uh
28:05
method that I want to invoke from uh
28:05
method that I want to invoke from uh this service B
28:08
this service B
28:08
this service B instance so whether forecast is named
28:12
instance so whether forecast is named
28:12
instance so whether forecast is named okay and you can also pass a
28:14
okay and you can also pass a
28:14
okay and you can also pass a cancellation token which is the best
28:17
cancellation token which is the best
28:17
cancellation token which is the best practice however I want I don't want to
28:19
practice however I want I don't want to
28:19
practice however I want I don't want to do this in this H particular
28:22
do this in this H particular
28:22
do this in this H particular session and I think that is it bar
28:26
session and I think that is it bar
28:26
session and I think that is it bar result is going to be await this
28:29
result is going to be await this
28:29
result is going to be await this of course this has to be a syn task of I
28:32
of course this has to be a syn task of I
28:32
of course this has to be a syn task of I inumerable of weather
28:34
inumerable of weather
28:34
inumerable of weather forecast just as we're
28:37
forecast just as we're
28:37
forecast just as we're expecting and I can go ahead and return
28:40
expecting and I can go ahead and return
28:40
expecting and I can go ahead and return okay result and that's it
28:44
okay result and that's it
28:44
okay result and that's it okay
28:46
okay
28:46
okay um is this uh result an iable of weather
28:50
um is this uh result an iable of weather
28:50
um is this uh result an iable of weather forecast yes okay cannot implicitly
28:55
forecast yes okay cannot implicitly
28:55
forecast yes okay cannot implicitly conver uh yeah i a
28:58
conver uh yeah i a
28:58
conver uh yeah i a what is the the interface I action
29:02
what is the the interface I action
29:02
what is the the interface I action result of
29:05
result of
29:05
result of iall of whether
29:08
iall of whether
29:09
iall of whether forecast is that I action result or this
29:14
forecast is that I action result or this
29:14
forecast is that I action result or this this is better the concrete
29:15
this is better the concrete
29:15
this is better the concrete implementation of Act of the action
29:18
implementation of Act of the action
29:18
implementation of Act of the action result I action result
29:20
result I action result
29:20
result I action result interface anyway you can see that I'm
29:23
interface anyway you can see that I'm
29:23
interface anyway you can see that I'm using invoke method I'm not using HTTP
29:26
using invoke method I'm not using HTTP
29:26
using invoke method I'm not using HTTP client or I HTTP client Factory or your
29:32
client or I HTTP client Factory or your
29:32
client or I HTTP client Factory or your own programming language HTTP idiom
29:37
own programming language HTTP idiom
29:37
own programming language HTTP idiom right you're just using the invoke
29:40
right you're just using the invoke
29:40
right you're just using the invoke method that comes from the SDK and
29:42
method that comes from the SDK and
29:42
method that comes from the SDK and that's
29:43
that's
29:43
that's it so it looks like this is complete
29:48
it so it looks like this is complete
29:48
it so it looks like this is complete this is um invoking this method that we
29:53
this is um invoking this method that we
29:53
this is um invoking this method that we have here and let me see if I can reuse
30:00
have here and let me see if I can reuse
30:00
have here and let me see if I can reuse uh I can refactor this into a primary
30:04
uh I can refactor this into a primary
30:04
uh I can refactor this into a primary Constructor and I think that's it
30:08
Constructor and I think that's it
30:09
Constructor and I think that's it now let's go back to the material to the
30:13
now let's go back to the material to the
30:13
now let's go back to the material to the training content since I want to mention
30:17
training content since I want to mention
30:17
training content since I want to mention how we can execute Dapper applications
30:21
how we can execute Dapper applications
30:21
how we can execute Dapper applications you have to remember that you have to
30:23
you have to remember that you have to
30:23
you have to remember that you have to pass if you're using D Ron the app ID
30:27
pass if you're using D Ron the app ID
30:27
pass if you're using D Ron the app ID for FL and then the upper HTTP port or
30:31
for FL and then the upper HTTP port or
30:31
for FL and then the upper HTTP port or if you're happen to be using
30:34
if you're happen to be using
30:34
if you're happen to be using erpc then you have to specify the erpc
30:38
erpc then you have to specify the erpc
30:38
erpc then you have to specify the erpc port this is for the side car and then
30:41
port this is for the side car and then
30:41
port this is for the side car and then the app port number that your
30:44
the app port number that your
30:44
the app port number that your application is using of course that's
30:46
application is using of course that's
30:46
application is using of course that's why you can use um the URLs flag if you
30:50
why you can use um the URLs flag if you
30:50
why you can use um the URLs flag if you happen to be using net so you have more
30:54
happen to be using net so you have more
30:54
happen to be using net so you have more control over the port that you
30:57
control over the port that you
30:58
control over the port that you application is using and then the
31:01
application is using and then the
31:01
application is using and then the separator right Double Dash and then
31:06
separator right Double Dash and then
31:06
separator right Double Dash and then your Specific Instructions for running
31:09
your Specific Instructions for running
31:09
your Specific Instructions for running the application such as net
31:11
the application such as net
31:11
the application such as net run and
31:13
run and
31:13
run and then the URLs flag and so on and
31:17
then the URLs flag and so on and
31:18
then the URLs flag and so on and basically that's it okay so I'm I want
31:22
basically that's it okay so I'm I want
31:22
basically that's it okay so I'm I want to copy this since I don't want to watch
31:25
to copy this since I don't want to watch
31:25
to copy this since I don't want to watch you see me typing all the time so let's
31:29
you see me typing all the time so let's
31:29
you see me typing all the time so let's go ahead and let's change the folder to
31:32
go ahead and let's change the folder to
31:32
go ahead and let's change the folder to service
31:34
service
31:34
service a and let's name it service
31:37
a and let's name it service
31:37
a and let's name it service a and let's
31:41
a and let's
31:41
a and let's use
31:43
use
31:43
use 5500 and here 55,000 because I remember
31:47
5500 and here 55,000 because I remember
31:47
5500 and here 55,000 because I remember that we had some problems with the 5,000
31:53
that we had some problems with the 5,000
31:53
that we had some problems with the 5,000 port and then yes uh 5500
31:58
port and then yes uh 5500
31:58
port and then yes uh 5500 right so this is service
32:01
right so this is service
32:01
right so this is service a okay uh there is an error uh type or
32:06
a okay uh there is an error uh type or
32:06
a okay uh there is an error uh type or namespace name dopper client couldn't be
32:09
namespace name dopper client couldn't be
32:09
namespace name dopper client couldn't be found is that is that right what's going
32:13
found is that is that right what's going
32:13
found is that is that right what's going on
32:15
on
32:15
on here so
32:17
here so
32:17
here so rebuild yes I have that same error
32:23
rebuild yes I have that same error
32:23
rebuild yes I have that same error okay I had to compile the
32:26
okay I had to compile the
32:26
okay I had to compile the application let's try
32:29
application let's try
32:29
application let's try again toer Ron specify the application
32:33
again toer Ron specify the application
32:33
again toer Ron specify the application name the ports and that's
32:37
name the ports and that's
32:37
name the ports and that's it okay so this is running and then
32:40
it okay so this is running and then
32:40
it okay so this is running and then let's do the
32:41
let's do the
32:41
let's do the same with service B so dopper in
32:45
same with service B so dopper in
32:45
same with service B so dopper in action and doer on service
32:50
action and doer on service
32:50
action and doer on service B which is right here and then Theon app
32:56
B which is right here and then Theon app
32:56
B which is right here and then Theon app ID service B I'm running the side car
33:00
ID service B I'm running the side car
33:00
ID service B I'm running the side car right uh hopefully this makes sense
33:03
right uh hopefully this makes sense
33:03
right uh hopefully this makes sense since I'm not communicating between
33:05
since I'm not communicating between
33:05
since I'm not communicating between those two Services directly I'm running
33:08
those two Services directly I'm running
33:08
those two Services directly I'm running those side cars right I'm doing this
33:13
those side cars right I'm doing this
33:13
those side cars right I'm doing this precisely right I'm executing my service
33:17
precisely right I'm executing my service
33:17
precisely right I'm executing my service a with the side car and then service B
33:20
a with the side car and then service B
33:20
a with the side car and then service B with its side car as well right and then
33:24
with its side car as well right and then
33:24
with its side car as well right and then all the magic happens thanks to the
33:25
all the magic happens thanks to the
33:25
all the magic happens thanks to the service invocation building block
33:28
service invocation building block
33:28
service invocation building block so let's use I don't know
33:32
so let's use I don't know
33:32
so let's use I don't know 5501 and then
33:35
5501 and then
33:35
5501 and then 55,1 and just like
33:38
55,1 and just like
33:38
55,1 and just like this and
33:40
this and
33:40
this and hopefully this works because I don't
33:42
hopefully this works because I don't
33:42
hopefully this works because I don't remember compiling the application so
33:46
remember compiling the application so
33:46
remember compiling the application so actually tell you what let me try again
33:49
actually tell you what let me try again
33:49
actually tell you what let me try again net build and let's do this okay so at
33:55
net build and let's do this okay so at
33:55
net build and let's do this okay so at this moment I have both Services running
33:59
this moment I have both Services running
33:59
this moment I have both Services running in my
34:00
in my
34:00
in my application in my computer as a
34:03
application in my computer as a
34:03
application in my computer as a self-hosted mode and each service has
34:07
self-hosted mode and each service has
34:07
self-hosted mode and each service has its own side car that's why I have a
34:10
its own side car that's why I have a
34:10
its own side car that's why I have a couple of you know tabs here in the
34:13
couple of you know tabs here in the
34:13
couple of you know tabs here in the windows
34:14
windows
34:14
windows terminal I'm using Dapper Ron each time
34:17
terminal I'm using Dapper Ron each time
34:17
terminal I'm using Dapper Ron each time because I'm not using the the you know
34:20
because I'm not using the the you know
34:21
because I'm not using the the you know the file similar to Docker compos we're
34:24
the file similar to Docker compos we're
34:24
the file similar to Docker compos we're going to do that in a following session
34:27
going to do that in a following session
34:27
going to do that in a following session however my goal here today is to show
34:30
however my goal here today is to show
34:30
however my goal here today is to show you how the service implication building
34:33
you how the service implication building
34:33
you how the service implication building block
34:35
block
34:35
block works so that said let's go ahead
34:40
works so that said let's go ahead
34:40
works so that said let's go ahead and let's try to
34:43
and let's try to
34:43
and let's try to run
34:44
run
34:45
run the the service invocation building blog
34:48
the the service invocation building blog
34:48
the the service invocation building blog I'm sorry the service a instance hello
34:51
I'm sorry the service a instance hello
34:52
I'm sorry the service a instance hello my friend
34:53
my friend
34:53
my friend Lanka how are you
34:57
Lanka how are you
34:57
Lanka how are you so okay so
35:00
so okay so
35:00
so okay so 510 can I do
35:03
510 can I do
35:03
510 can I do this Local Host
35:07
this Local Host
35:07
this Local Host 5500 and
35:09
5500 and
35:09
5500 and query right you might remember that we
35:13
query right you might remember that we
35:13
query right you might remember that we have we have the query
35:15
have we have the query
35:15
have we have the query controller let's go back here we have
35:17
controller let's go back here we have
35:17
controller let's go back here we have the query controller so with this syntax
35:21
the query controller so with this syntax
35:21
the query controller so with this syntax if you're not asp.net core developer
35:25
if you're not asp.net core developer
35:25
if you're not asp.net core developer this syntax is going to use the prefix
35:28
this syntax is going to use the prefix
35:28
this syntax is going to use the prefix of the class name in other words it's
35:31
of the class name in other words it's
35:31
of the class name in other words it's going to use
35:32
going to use
35:32
going to use Query which is a
35:35
Query which is a
35:35
Query which is a prefix before
35:37
prefix before
35:37
prefix before controller that is actually the syntax
35:39
controller that is actually the syntax
35:39
controller that is actually the syntax that we use in asp.net core maybe if
35:42
that we use in asp.net core maybe if
35:42
that we use in asp.net core maybe if you're a python developer or maybe
35:45
you're a python developer or maybe
35:45
you're a python developer or maybe another programming language developer
35:48
another programming language developer
35:48
another programming language developer this actually is kind of um weird but
35:53
this actually is kind of um weird but
35:53
this actually is kind of um weird but this is
35:54
this is
35:54
this is happening and with this attribute this
35:57
happening and with this attribute this
35:57
happening and with this attribute this is is um you know query
36:01
is is um you know query
36:01
is is um you know query endpoint um I'm I'm glad Lan I'm glad so
36:08
endpoint um I'm I'm glad Lan I'm glad so
36:08
endpoint um I'm I'm glad Lan I'm glad so Carl and enabl to resolve service for
36:12
Carl and enabl to resolve service for
36:12
Carl and enabl to resolve service for Tye doer client doer CLI yes of course
36:15
Tye doer client doer CLI yes of course
36:15
Tye doer client doer CLI yes of course something is
36:16
something is
36:16
something is missing so what's missing my friends can
36:20
missing so what's missing my friends can
36:20
missing so what's missing my friends can you tell
36:21
you tell
36:21
you tell me so the thing is that I didn't add the
36:25
me so the thing is that I didn't add the
36:26
me so the thing is that I didn't add the dopper client object here
36:28
dopper client object here
36:28
dopper client object here here of course I included the you know
36:32
here of course I included the you know
36:32
here of course I included the you know the nug
36:33
the nug
36:33
the nug package right here
36:36
package right here
36:36
package right here however that's not enough you need to
36:39
however that's not enough you need to
36:39
however that's not enough you need to add Dapper add
36:42
add Dapper add
36:42
add Dapper add Dapper and that is it okay let me
36:47
Dapper and that is it okay let me
36:47
Dapper and that is it okay let me rebuild service a let's go back to the
36:51
rebuild service a let's go back to the
36:51
rebuild service a let's go back to the terminal service a let's try this again
36:55
terminal service a let's try this again
36:55
terminal service a let's try this again and service B actually stoping
36:58
and service B actually stoping
36:58
and service B actually stoping stopping service B wasn't necessary I
37:01
stopping service B wasn't necessary I
37:01
stopping service B wasn't necessary I just needed to rebuild service a so all
37:05
just needed to rebuild service a so all
37:06
just needed to rebuild service a so all of those services are running right now
37:09
of those services are running right now
37:09
of those services are running right now curl
37:11
curl
37:11
curl and this is
37:14
and this is
37:14
and this is returning the you know the payload from
37:17
returning the you know the payload from
37:17
returning the you know the payload from service B Because service a used the
37:21
service B Because service a used the
37:21
service B Because service a used the side car and the side car communicated
37:23
side car and the side car communicated
37:23
side car and the side car communicated to service b side car and this is
37:27
to service b side car and this is
37:27
to service b side car and this is actually what's happening today this
37:30
actually what's happening today this
37:30
actually what's happening today this diagram my friends
37:33
diagram my friends
37:33
diagram my friends okay so speaking about the name
37:36
okay so speaking about the name
37:36
okay so speaking about the name resolution component as I mentioned
37:38
resolution component as I mentioned
37:38
resolution component as I mentioned before um you don't have to do anything
37:40
before um you don't have to do anything
37:40
before um you don't have to do anything additional it just works uh out of the
37:44
additional it just works uh out of the
37:44
additional it just works uh out of the box and that is fantastic this is
37:48
box and that is fantastic this is
37:48
box and that is fantastic this is glorious
37:50
glorious
37:50
glorious right perfect so now let's talk about
37:55
right perfect so now let's talk about
37:55
right perfect so now let's talk about um let's see we can create a resiliency
38:01
um let's see we can create a resiliency
38:01
um let's see we can create a resiliency policy so I want to show you this thing
38:06
policy so I want to show you this thing
38:06
policy so I want to show you this thing the resiliency
38:08
the resiliency
38:08
the resiliency policy so let's go ahead and
38:13
policy so let's go ahead and
38:13
policy so let's go ahead and open I don't remember the schema of
38:16
open I don't remember the schema of
38:16
open I don't remember the schema of course
38:18
course
38:18
course um
38:20
um
38:20
um and I know what I have to tell you right
38:23
and I know what I have to tell you right
38:23
and I know what I have to tell you right now before I try to implement the
38:26
now before I try to implement the
38:26
now before I try to implement the resiliency policy
38:28
resiliency policy
38:28
resiliency policy I need to explain a little bit
38:31
I need to explain a little bit
38:31
I need to explain a little bit more about the configuration that we
38:35
more about the configuration that we
38:35
more about the configuration that we have in Dapper okay so we can see that
38:38
have in Dapper okay so we can see that
38:38
have in Dapper okay so we can see that this is working it's it's just like
38:41
this is working it's it's just like
38:41
this is working it's it's just like magic thanks to our Dapper friends and
38:45
magic thanks to our Dapper friends and
38:45
magic thanks to our Dapper friends and thankfully this works
38:48
thankfully this works
38:48
thankfully this works fantastic so you might remember that we
38:50
fantastic so you might remember that we
38:50
fantastic so you might remember that we have the hum Fuller is that hum Fuller
38:54
have the hum Fuller is that hum Fuller
38:54
have the hum Fuller is that hum Fuller oh my God what happens today with my
38:56
oh my God what happens today with my
38:56
oh my God what happens today with my fingers
38:58
fingers
38:58
fingers do dapper in here you can find all the
39:02
do dapper in here you can find all the
39:02
do dapper in here you can find all the Dapper binaries
39:04
Dapper binaries
39:04
Dapper binaries right so this is Dapper folder in your
39:09
right so this is Dapper folder in your
39:09
right so this is Dapper folder in your machine and you can find a file named
39:14
machine and you can find a file named
39:14
machine and you can find a file named config
39:15
config
39:15
config Dojo config
39:19
Dojo config
39:19
Dojo config Dojo so this is this is quite critical
39:22
Dojo so this is this is quite critical
39:22
Dojo so this is this is quite critical okay configuration is this uh object
39:27
okay configuration is this uh object
39:27
okay configuration is this uh object okay you can see that I'm using API
39:30
okay you can see that I'm using API
39:30
okay you can see that I'm using API version kind metadata and spec similar
39:32
version kind metadata and spec similar
39:33
version kind metadata and spec similar to what we do in
39:35
to what we do in
39:35
to what we do in kubernetes so this is a configuration
39:37
kubernetes so this is a configuration
39:37
kubernetes so this is a configuration object for Dapper and inside the spec
39:42
object for Dapper and inside the spec
39:42
object for Dapper and inside the spec you can
39:43
you can
39:43
you can see
39:45
see
39:45
see that um this is specifying the
39:49
that um this is specifying the
39:49
that um this is specifying the tracing
39:51
tracing
39:51
tracing configuration and for
39:54
configuration and for
39:54
configuration and for tracing it's using Zipkin right we can
39:58
tracing it's using Zipkin right we can
39:58
tracing it's using Zipkin right we can see that Zipkin endpoint address and
40:00
see that Zipkin endpoint address and
40:00
see that Zipkin endpoint address and this is pointing to this uh Local Host
40:04
this is pointing to this uh Local Host
40:04
this is pointing to this uh Local Host 941 and so on and so on
40:09
941 and so on and so on
40:09
941 and so on and so on right and this is because uh if I type
40:13
right and this is because uh if I type
40:13
right and this is because uh if I type Docker PS I'm also running
40:17
Docker PS I'm also running
40:17
Docker PS I'm also running Zipkin so I didn't do this it was the
40:20
Zipkin so I didn't do this it was the
40:20
Zipkin so I didn't do this it was the Dapper initialization process that
40:23
Dapper initialization process that
40:23
Dapper initialization process that pulled Zipkin uh image the Zipkin image
40:27
pulled Zipkin uh image the Zipkin image
40:27
pulled Zipkin uh image the Zipkin image and then run Zipkin as a container in my
40:31
and then run Zipkin as a container in my
40:31
and then run Zipkin as a container in my machine so this is fantastic and I'm
40:35
machine so this is fantastic and I'm
40:35
machine so this is fantastic and I'm using
40:37
using
40:37
using the uh service invocation building block
40:41
the uh service invocation building block
40:41
the uh service invocation building block and how in the world is disconnected to
40:45
and how in the world is disconnected to
40:45
and how in the world is disconnected to what I'm
40:46
what I'm
40:47
what I'm explaining uh today about the D
40:49
explaining uh today about the D
40:49
explaining uh today about the D invocation building block and the
40:51
invocation building block and the
40:51
invocation building block and the configuration I'm sorry config
40:54
configuration I'm sorry config
40:54
configuration I'm sorry config Dojo so the thing is that inside
40:57
Dojo so the thing is that inside
40:57
Dojo so the thing is that inside this um this
41:01
this um this
41:01
this um this file you can edit this file or you can
41:05
file you can edit this file or you can
41:05
file you can edit this file or you can take this configuration and put it in
41:07
take this configuration and put it in
41:07
take this configuration and put it in your Source control and you can
41:10
your Source control and you can
41:10
your Source control and you can configure different things and different
41:13
configure different things and different
41:13
configure different things and different features for your
41:15
features for your
41:15
features for your Dapper um
41:18
Dapper um
41:18
Dapper um installation so for instance I'm uh
41:22
installation so for instance I'm uh
41:22
installation so for instance I'm uh configuring tracing here but you can
41:24
configuring tracing here but you can
41:25
configuring tracing here but you can also configure the Matrix feature you
41:29
also configure the Matrix feature you
41:29
also configure the Matrix feature you can also configure the name resolution
41:32
can also configure the name resolution
41:33
can also configure the name resolution component um and many many many things
41:36
component um and many many many things
41:36
component um and many many many things so let me see if I can daer
41:39
so let me see if I can daer
41:39
so let me see if I can daer configuration config Jam let's see if I
41:42
configuration config Jam let's see if I
41:42
configuration config Jam let's see if I can find
41:44
can find
41:44
can find this and this is
41:47
this and this is
41:47
this and this is it so we can
41:51
configure tracing Matrix logging
41:56
configure tracing Matrix logging
41:56
configure tracing Matrix logging middleware name resolution scope Secret
41:59
middleware name resolution scope Secret
41:59
middleware name resolution scope Secret store AIS and so on I'm not going to
42:01
store AIS and so on I'm not going to
42:01
store AIS and so on I'm not going to read the entire list here so you can see
42:03
read the entire list here so you can see
42:03
read the entire list here so you can see that this is the place where we can do
42:06
that this is the place where we can do
42:06
that this is the place where we can do this okay so tracing is preconfigured
42:11
this okay so tracing is preconfigured
42:11
this okay so tracing is preconfigured thanks to the dopper initialization
42:13
thanks to the dopper initialization
42:13
thanks to the dopper initialization process meaning that all
42:16
process meaning that all
42:17
process meaning that all the um communication that is happening
42:19
the um communication that is happening
42:19
the um communication that is happening between those two Services is being
42:22
between those two Services is being
42:22
between those two Services is being traced how can I show you this you may
42:26
traced how can I show you this you may
42:26
traced how can I show you this you may be asking
42:28
be asking
42:28
be asking uh let's try this again Docker PS Zipkin
42:31
uh let's try this again Docker PS Zipkin
42:31
uh let's try this again Docker PS Zipkin is running inside my computer is using
42:35
is running inside my computer is using
42:36
is running inside my computer is using this port
42:38
this port
42:38
this port 9411 so let me go ahead and navigate to
42:42
9411 so let me go ahead and navigate to
42:42
9411 so let me go ahead and navigate to Local
42:43
Local
42:43
Local Host this
42:45
Host this
42:45
Host this port is this the is this the port number
42:50
port is this the is this the port number
42:50
port is this the is this the port number Zipkin 94 9410 I think it's this other
42:55
Zipkin 94 9410 I think it's this other
42:55
Zipkin 94 9410 I think it's this other one
42:57
one
42:57
one Local Host
42:59
Local Host
42:59
Local Host 9410 no
43:02
9410 no
43:02
9410 no 9411 Zipkin tipin uh I think something
43:06
9411 Zipkin tipin uh I think something
43:06
9411 Zipkin tipin uh I think something is missing no
43:09
is missing no
43:09
is missing no 9411 and I don't know what's going on
43:11
9411 and I don't know what's going on
43:11
9411 and I don't know what's going on here the thing is that this is being
43:13
here the thing is that this is being
43:13
here the thing is that this is being configured thanks to this configuration
43:15
configured thanks to this configuration
43:15
configured thanks to this configuration and of course I'm going to show you the
43:18
and of course I'm going to show you the
43:18
and of course I'm going to show you the um
43:20
um
43:20
um observability uh options for Dapper in a
43:23
observability uh options for Dapper in a
43:23
observability uh options for Dapper in a following session and today I just want
43:26
following session and today I just want
43:26
following session and today I just want to show you
43:27
to show you
43:27
to show you this configuration this is the place
43:30
this configuration this is the place
43:30
this configuration this is the place okay 9411 I don't think this is running
43:34
okay 9411 I don't think this is running
43:34
okay 9411 I don't think this is running I don't know why it should be
43:38
I don't know why it should be
43:38
I don't know why it should be running and I could be oh this is
43:41
running and I could be oh this is
43:41
running and I could be oh this is running so forward slash zipin this is
43:44
running so forward slash zipin this is
43:44
running so forward slash zipin this is it I was trying to reach the root end
43:48
it I was trying to reach the root end
43:48
it I was trying to reach the root end point and it's actually forward slash
43:51
point and it's actually forward slash
43:51
point and it's actually forward slash Zipkin just like
43:53
Zipkin just like
43:53
Zipkin just like this and if I do this
43:57
this and if I do this
43:57
this and if I do this Zipkin is this Telemetry and Trace
44:02
Zipkin is this Telemetry and Trace
44:02
Zipkin is this Telemetry and Trace traceability um
44:05
traceability um
44:05
traceability um platform that is obtaining that
44:08
platform that is obtaining that
44:08
platform that is obtaining that information that is happening in my
44:10
information that is happening in my
44:10
information that is happening in my computer okay between those two
44:13
computer okay between those two
44:13
computer okay between those two services and if I show you all of the
44:18
services and if I show you all of the
44:18
services and if I show you all of the different things that that are
44:20
different things that that are
44:20
different things that that are happening um so let me see if I can find
44:25
happening um so let me see if I can find
44:25
happening um so let me see if I can find service a service B well I have those
44:28
service a service B well I have those
44:28
service a service B well I have those here
44:30
here
44:30
here and and and I don't know what's going
44:34
and and and I don't know what's going
44:34
and and and I don't know what's going on the thing is that everything is being
44:37
on the thing is that everything is being
44:37
on the thing is that everything is being loged here somehow I'm missing something
44:41
loged here somehow I'm missing something
44:41
loged here somehow I'm missing something however this is not the thing that I
44:43
however this is not the thing that I
44:43
however this is not the thing that I want to show you the thing that I want
44:44
want to show you the thing that I want
44:44
want to show you the thing that I want to show you is the
44:46
to show you is the
44:46
to show you is the resiliency policies that we can
44:48
resiliency policies that we can
44:48
resiliency policies that we can configure so let's go back
44:50
configure so let's go back
44:50
configure so let's go back here and let me see if I can remember
44:55
here and let me see if I can remember
44:55
here and let me see if I can remember where is this
44:58
where is this
44:58
where is this uh so
45:02
resiliency um let me go back here Access
45:09
resiliency um let me go back here Access
45:09
resiliency um let me go back here Access Control Access Control let me see if I
45:15
Control Access Control let me see if I
45:15
Control Access Control let me see if I can uh no let me see dopper resiliency
45:20
can uh no let me see dopper resiliency
45:20
can uh no let me see dopper resiliency resilency
45:23
we go back here so this is the
45:27
we go back here so this is the
45:27
we go back here so this is the resiliency service to service and this
45:29
resiliency service to service and this
45:29
resiliency service to service and this is it
45:32
is it
45:32
is it yes as I was mentioning before what
45:35
yes as I was mentioning before what
45:35
yes as I was mentioning before what happens if service B goes down right how
45:39
happens if service B goes down right how
45:39
happens if service B goes down right how do you manage that
45:41
do you manage that
45:41
do you manage that thankfully the resiliency policy is
45:43
thankfully the resiliency policy is
45:43
thankfully the resiliency policy is something that you can configure outside
45:45
something that you can configure outside
45:45
something that you can configure outside your application so you can see that we
45:48
your application so you can see that we
45:48
your application so you can see that we need to pass a resiliency object just
45:52
need to pass a resiliency object just
45:52
need to pass a resiliency object just like the one that I'm showing you here
45:55
like the one that I'm showing you here
45:55
like the one that I'm showing you here and let me expand this okay and inside
46:01
and let me expand this okay and inside
46:01
and let me expand this okay and inside this resiliency object you have to
46:03
this resiliency object you have to
46:03
this resiliency object you have to specify the different policies that are
46:07
specify the different policies that are
46:07
specify the different policies that are available such as uh retries circuit
46:11
available such as uh retries circuit
46:11
available such as uh retries circuit breakers and timeouts I think we have we
46:14
breakers and timeouts I think we have we
46:14
breakers and timeouts I think we have we can see let me duplicate this and here
46:18
can see let me duplicate this and here
46:18
can see let me duplicate this and here let me go back
46:21
let me go back
46:21
let me go back resiliency
46:24
resiliency service to service
46:29
I want to show you the entire
46:34
I want to show you the entire
46:34
I want to show you the entire schema anyway I think this is enough for
46:38
schema anyway I think this is enough for
46:38
schema anyway I think this is enough for today retri circuit breakers and then
46:41
today retri circuit breakers and then
46:41
today retri circuit breakers and then timeouts which is not here you have to
46:43
timeouts which is not here you have to
46:43
timeouts which is not here you have to specify those policies and then you can
46:46
specify those policies and then you can
46:46
specify those policies and then you can specify check this out here down below
46:50
specify check this out here down below
46:50
specify check this out here down below you can specify the name of the
46:52
you can specify the name of the
46:52
you can specify the name of the application that you you want to apply
46:57
application that you you want to apply
46:57
application that you you want to apply those those policies to right for
47:00
those those policies to right for
47:00
those those policies to right for instance this schema is creating this
47:03
instance this schema is creating this
47:03
instance this schema is creating this retri forever right retry forever and
47:09
retri forever right retry forever and
47:09
retri forever right retry forever and this is configuring this policy for
47:12
this is configuring this policy for
47:12
this is configuring this policy for retries okay constant Max interval Max
47:15
retries okay constant Max interval Max
47:15
retries okay constant Max interval Max retries forever so this is going to
47:17
retries forever so this is going to
47:17
retries forever so this is going to retry forever right and this other
47:20
retry forever right and this other
47:20
retry forever right and this other policy is going to the name is simple CB
47:24
policy is going to the name is simple CB
47:24
policy is going to the name is simple CB it could be Batman or it could be
47:26
it could be Batman or it could be
47:26
it could be Batman or it could be Spider-Man the name actually is
47:28
Spider-Man the name actually is
47:28
Spider-Man the name actually is something that you can change and then
47:30
something that you can change and then
47:30
something that you can change and then Max requests timeout and trip uh you
47:34
Max requests timeout and trip uh you
47:34
Max requests timeout and trip uh you have to specify those values and there
47:37
have to specify those values and there
47:37
have to specify those values and there are some other values if you happen to
47:40
are some other values if you happen to
47:40
are some other values if you happen to read the entire
47:41
read the entire
47:41
read the entire documentation and then you use that
47:44
documentation and then you use that
47:44
documentation and then you use that policy here for your specific um for
47:49
policy here for your specific um for
47:49
policy here for your specific um for your specific service instance so let me
47:53
your specific service instance so let me
47:53
your specific service instance so let me try this I didn't do this beforehand
47:57
try this I didn't do this beforehand
47:57
try this I didn't do this beforehand so it doesn't
47:59
so it doesn't
47:59
so it doesn't matter I'm not fearing
48:02
matter I'm not fearing
48:02
matter I'm not fearing any um anything right now let's try this
48:06
any um anything right now let's try this
48:06
any um anything right now let's try this friends we're are
48:08
friends we're are
48:08
friends we're are developers right so let's stop this and
48:12
developers right so let's stop this and
48:12
developers right so let's stop this and this and let me
48:15
this and let me
48:16
this and let me see what if we create I don't know
48:20
see what if we create I don't know
48:20
see what if we create I don't know config and then config and then
48:24
config and then config and then
48:24
config and then config and then resiliency dojo let's create this file
48:29
resiliency dojo let's create this file
48:29
resiliency dojo let's create this file paste the entire thing right I'm using
48:33
paste the entire thing right I'm using
48:33
paste the entire thing right I'm using jaml because uh you know you only live
48:38
jaml because uh you know you only live
48:38
jaml because uh you know you only live once resiliency my resiliency I think
48:42
once resiliency my resiliency I think
48:42
once resiliency my resiliency I think those two those values are
48:44
those two those values are
48:44
those two those values are perfect and I'm going to use the the
48:47
perfect and I'm going to use the the
48:47
perfect and I'm going to use the the same names as I mentioned before this
48:49
same names as I mentioned before this
48:49
same names as I mentioned before this could be Batman
48:51
could be Batman
48:51
could be Batman right and of course you have to change
48:53
right and of course you have to change
48:53
right and of course you have to change the name here as well and let me change
48:58
the name here as well and let me change
48:58
the name here as well and let me change the name of the application so service B
49:02
the name of the application so service B
49:02
the name of the application so service B okay this is the app ID friends okay so
49:05
okay this is the app ID friends okay so
49:05
okay this is the app ID friends okay so it has to
49:06
it has to
49:06
it has to match so in other words for that in the
49:10
match so in other words for that in the
49:10
match so in other words for that in the documentation there's an order processor
49:13
documentation there's an order processor
49:13
documentation there's an order processor thing or application that you should run
49:17
thing or application that you should run
49:17
thing or application that you should run to make it work and in our case we have
49:20
to make it work and in our case we have
49:20
to make it work and in our case we have service B and I think that is it that is
49:24
service B and I think that is it that is
49:24
service B and I think that is it that is it we have our resiliency do Jam file
49:28
it we have our resiliency do Jam file
49:28
it we have our resiliency do Jam file and then we need to pass the folder
49:32
and then we need to pass the folder
49:32
and then we need to pass the folder where this application has the scripts
49:35
where this application has the scripts
49:35
where this application has the scripts right we can do that by using resources
49:39
right we can do that by using resources
49:40
right we can do that by using resources path just like
49:42
path just like
49:42
path just like this so resources path so let me go back
49:47
this so resources path so let me go back
49:47
this so resources path so let me go back here to the
49:49
here to the
49:49
here to the terminal and let's try this again so
49:52
terminal and let's try this again so
49:52
terminal and let's try this again so service a is going to be
49:56
service a is going to be
49:56
service a is going to be this Dr and run service a
50:02
this Dr and run service a
50:02
this Dr and run service a 5500 and this is running right
50:07
5500 and this is running right
50:07
5500 and this is running right and this is
50:09
and this is
50:09
and this is service a this is service a okay this is
50:14
service a this is service a okay this is
50:14
service a this is service a okay this is going to be service B then right because
50:17
going to be service B then right because
50:17
going to be service B then right because I used this other uh tab anyway service
50:22
I used this other uh tab anyway service
50:22
I used this other uh tab anyway service B is going to
50:24
B is going to
50:24
B is going to be this
50:27
be this
50:27
be this um oh
50:29
um oh
50:29
um oh no I don't have the previous command
50:33
no I don't have the previous command
50:33
no I don't have the previous command anyway I have to change it service B
50:36
anyway I have to change it service B
50:36
anyway I have to change it service B 5501
50:38
5501
50:38
5501 55,1 and just like this
50:42
55,1 and just like this
50:42
55,1 and just like this and remember resources path is that
50:47
and remember resources path is that
50:47
and remember resources path is that right resources path and
50:51
right resources path and
50:51
right resources path and then one
50:54
then one
50:54
then one level above right and
50:57
level above right and
50:57
level above right and config and that's it I think this is the
51:00
config and that's it I think this is the
51:00
config and that's it I think this is the you know the
51:03
you know the
51:03
you know the relative uh path for pointing to that
51:06
relative uh path for pointing to that
51:06
relative uh path for pointing to that config folder that I just created that
51:09
config folder that I just created that
51:09
config folder that I just created that has the resiliency doj
51:11
has the resiliency doj
51:11
has the resiliency doj file and that is it oh I'm
51:15
file and that is it oh I'm
51:15
file and that is it oh I'm sorry oh
51:18
sorry oh
51:18
sorry oh no oh no I lost
51:21
no oh no I lost
51:21
no oh no I lost everything let me try this again
51:24
everything let me try this again
51:24
everything let me try this again 55,1 and this and and resources path and
51:30
55,1 and this and and resources path and
51:30
55,1 and this and and resources path and then config and this is
51:34
then config and this is
51:34
then config and this is it
51:36
it
51:36
it right so in other words service B now is
51:40
right so in other words service B now is
51:40
right so in other words service B now is running with those policies in place I'm
51:44
running with those policies in place I'm
51:44
running with those policies in place I'm configuring you know the resilency
51:47
configuring you know the resilency
51:47
configuring you know the resilency policies for service B meaning that if
51:51
policies for service B meaning that if
51:51
policies for service B meaning that if something fails then it's going to the
51:53
something fails then it's going to the
51:53
something fails then it's going to the the client service is going to retry
51:59
so uh let me go back here
52:04
so uh let me go back here
52:04
so uh let me go back here and um is that curl where is it curl
52:10
and um is that curl where is it curl
52:10
and um is that curl where is it curl this is running right this is
52:13
this is running right this is
52:13
this is running right this is running and what happens if I do this
52:19
running and what happens if I do this
52:19
running and what happens if I do this and then you can see that this is not
52:22
and then you can see that this is not
52:22
and then you can see that this is not returning immediately oh no maybe some
52:26
returning immediately oh no maybe some
52:26
returning immediately oh no maybe some there's something wrong it's returning
52:29
there's something wrong it's returning
52:29
there's something wrong it's returning so let me try this
52:31
so let me try this
52:31
so let me try this again
52:35
uh so this is running
52:38
uh so this is running
52:38
uh so this is running yes or maybe I should
52:45
use yes I'm I'm using that resources
52:50
use yes I'm I'm using that resources
52:50
use yes I'm I'm using that resources path in this other way let me try this
52:53
path in this other way let me try this
52:53
path in this other way let me try this again friends
52:56
again friends
52:56
again friends uh doer this is service a this is
52:59
uh doer this is service a this is
52:59
uh doer this is service a this is running correctly this is service
53:03
running correctly this is service
53:03
running correctly this is service B curl this is behaving correctly this
53:07
B curl this is behaving correctly this
53:07
B curl this is behaving correctly this is service
53:09
is service
53:09
is service B
53:13
and is this gonna return something or he
53:17
and is this gonna return something or he
53:17
and is this gonna return something or he just waiting it's just retrying
53:20
just waiting it's just retrying
53:20
just waiting it's just retrying right so there's something wrong my
53:23
right so there's something wrong my
53:23
right so there's something wrong my point is that maybe I'm not using the
53:28
point is that maybe I'm not using the
53:28
point is that maybe I'm not using the resources PAAD
53:30
resources PAAD
53:30
resources PAAD correctly right so I'm using resources
53:33
correctly right so I'm using resources
53:33
correctly right so I'm using resources PAAD in service
53:35
PAAD in service
53:35
PAAD in service B but maybe I should use that in service
53:39
B but maybe I should use that in service
53:39
B but maybe I should use that in service a
53:40
a
53:40
a instead so resources
53:43
instead so resources
53:43
instead so resources path and then
53:46
path and then
53:46
path and then config right so this is
53:49
config right so this is
53:50
config right so this is running let let's reuse that I don't
53:53
running let let's reuse that I don't
53:53
running let let's reuse that I don't think that's it's going to uh
53:56
think that's it's going to uh
53:56
think that's it's going to uh um change anything about service B right
54:00
um change anything about service B right
54:00
um change anything about service B right so if I go back here curl is going to
54:03
so if I go back here curl is going to
54:03
so if I go back here curl is going to work yeah it's running
54:07
work yeah it's running
54:07
work yeah it's running right and this is service
54:10
right and this is service
54:10
right and this is service B let me stop service B try this
54:16
again and is this going to
54:21
retry is this configured correctly is my
54:25
retry is this configured correctly is my
54:25
retry is this configured correctly is my resiliency doj file
54:27
resiliency doj file
54:27
resiliency doj file correct it looks like this is logging
54:30
correct it looks like this is logging
54:30
correct it looks like this is logging something right it's logging
54:34
something right it's logging
54:34
something right it's logging something
54:35
something
54:35
something and let me try with this policy again
54:39
and let me try with this policy again
54:39
and let me try with this policy again try
54:40
try
54:40
try curl
54:42
curl
54:42
curl and this is
54:45
and this is
54:45
and this is running this is running and this is
54:47
running this is running and this is
54:47
running this is running and this is running as
54:48
running as
54:49
running as well
54:51
well
54:51
well and now I'm receiving the data again
54:59
again H
55:02
again H
55:02
again H interesting there are so many questions
55:04
interesting there are so many questions
55:04
interesting there are so many questions that I have about the retre retry
55:07
that I have about the retre retry
55:07
that I have about the retre retry policies and the process that I'm using
55:10
policies and the process that I'm using
55:10
policies and the process that I'm using however
55:12
however
55:12
however remember you have to configure the
55:15
remember you have to configure the
55:15
remember you have to configure the resiliency doj file I think that's done
55:18
resiliency doj file I think that's done
55:18
resiliency doj file I think that's done I'm taking the same uh code that is
55:22
I'm taking the same uh code that is
55:22
I'm taking the same uh code that is inside
55:23
inside
55:23
inside the um documentation
55:26
the um documentation
55:26
the um documentation right
55:27
right
55:27
right here right here
55:30
here right here
55:30
here right here right
55:32
right
55:32
right and you have to create the resiliency
55:35
and you have to create the resiliency
55:35
and you have to create the resiliency doj file you have to pass that to your
55:37
doj file you have to pass that to your
55:37
doj file you have to pass that to your Dapper run uh command you have to
55:41
Dapper run uh command you have to
55:41
Dapper run uh command you have to specify the folder where this residency
55:44
specify the folder where this residency
55:44
specify the folder where this residency jaml file is and I think that is it
55:49
jaml file is and I think that is it
55:49
jaml file is and I think that is it right that is
55:51
right that is
55:51
right that is it so with that um there are so many any
55:56
it so with that um there are so many any
55:56
it so with that um there are so many any options about service invocation I'm
55:58
options about service invocation I'm
55:58
options about service invocation I'm just scratching the surface
56:00
just scratching the surface
56:00
just scratching the surface here um
56:03
here um
56:03
here um and so you can see that the initial and
56:06
and so you can see that the initial and
56:06
and so you can see that the initial and most basic usage of the service
56:10
most basic usage of the service
56:10
most basic usage of the service invocation building block uh Works
56:13
invocation building block uh Works
56:14
invocation building block uh Works marvelously right it's just fantastic
56:17
marvelously right it's just fantastic
56:17
marvelously right it's just fantastic you don't have to do anything else but
56:19
you don't have to do anything else but
56:19
you don't have to do anything else but of course you can configure a lot of
56:21
of course you can configure a lot of
56:21
of course you can configure a lot of different
56:22
different
56:22
different things I'm just realizing that there is
56:25
things I'm just realizing that there is
56:25
things I'm just realizing that there is some slide that is missing here in my
56:27
some slide that is missing here in my
56:27
some slide that is missing here in my deck I don't know what happened to my
56:30
deck I don't know what happened to my
56:30
deck I don't know what happened to my latest PowerPoint
56:32
latest PowerPoint
56:32
latest PowerPoint slide anyway it doesn't matter what
56:36
slide anyway it doesn't matter what
56:36
slide anyway it doesn't matter what matters friends is that you can
56:38
matters friends is that you can
56:38
matters friends is that you can configure your service invocation
56:40
configure your service invocation
56:40
configure your service invocation building block in this way and in this
56:44
building block in this way and in this
56:44
building block in this way and in this fashion and you don't have to do
56:46
fashion and you don't have to do
56:46
fashion and you don't have to do anything else to make it work and I
56:50
anything else to make it work and I
56:50
anything else to make it work and I think that is that is fantastic right
56:53
think that is that is fantastic right
56:53
think that is that is fantastic right that is fantastic and we're seeing that
56:55
that is fantastic and we're seeing that
56:55
that is fantastic and we're seeing that this is uh sending data to
56:58
this is uh sending data to
56:58
this is uh sending data to zkin right maybe it's because I'm just
57:02
zkin right maybe it's because I'm just
57:02
zkin right maybe it's because I'm just using um you know the public
57:06
using um you know the public
57:06
using um you know the public 5500 endpoint instead of using the side
57:09
5500 endpoint instead of using the side
57:09
5500 endpoint instead of using the side carard but I don't believe that is the
57:12
carard but I don't believe that is the
57:12
carard but I don't believe that is the reason
57:13
reason
57:13
reason why anyway remember the main point here
57:17
why anyway remember the main point here
57:17
why anyway remember the main point here is that you can use this in a very
57:20
is that you can use this in a very
57:20
is that you can use this in a very straightforward
57:22
straightforward
57:22
straightforward fashion I actually just included daer
57:26
fashion I actually just included daer
57:26
fashion I actually just included daer and used invoke methoding that is the
57:29
and used invoke methoding that is the
57:29
and used invoke methoding that is the most basic thing right the configuration
57:32
most basic thing right the configuration
57:32
most basic thing right the configuration around the service invocation building
57:34
around the service invocation building
57:34
around the service invocation building block is the is the most um uh Advanced
57:40
block is the is the most um uh Advanced
57:40
block is the is the most um uh Advanced thing about this building
57:43
thing about this building
57:43
thing about this building block and of course tracing we're going
57:46
block and of course tracing we're going
57:46
block and of course tracing we're going to see that in a following session also
57:51
to see that in a following session also
57:51
to see that in a following session also metrics and also resiliency because
57:54
metrics and also resiliency because
57:54
metrics and also resiliency because resiliency is not only for the service
57:56
resiliency is not only for the service
57:56
resiliency is not only for the service invocation building block it's also for
58:00
invocation building block it's also for
58:00
invocation building block it's also for the State Management building block and
58:02
the State Management building block and
58:02
the State Management building block and some others so we're going to revisit
58:05
some others so we're going to revisit
58:05
some others so we're going to revisit this code and the policies and we're
58:08
this code and the policies and we're
58:08
this code and the policies and we're going to reuse the same um the same
58:13
going to reuse the same um the same
58:13
going to reuse the same um the same topics in a following
58:16
topics in a following
58:16
topics in a following session okay so yes this is not my
58:18
session okay so yes this is not my
58:18
session okay so yes this is not my latest PowerPoint slide I think there
58:21
latest PowerPoint slide I think there
58:21
latest PowerPoint slide I think there are a couple of things missing here I
58:23
are a couple of things missing here I
58:23
are a couple of things missing here I was I had a slide talk talking about the
58:28
was I had a slide talk talking about the
58:28
was I had a slide talk talking about the resiliency policies and the jamama file
58:32
resiliency policies and the jamama file
58:32
resiliency policies and the jamama file however I think this is enough for today
58:36
however I think this is enough for today
58:36
however I think this is enough for today my
58:37
my
58:37
my friends if you happen to celebrate
58:40
friends if you happen to celebrate
58:40
friends if you happen to celebrate Christmas Merry Christmas if you don't
58:43
Christmas Merry Christmas if you don't
58:43
Christmas Merry Christmas if you don't it's okay um Merry Christmas as well um
58:48
it's okay um Merry Christmas as well um
58:48
it's okay um Merry Christmas as well um and see you next Monday okay I'm Rodrigo
58:51
and see you next Monday okay I'm Rodrigo
58:51
and see you next Monday okay I'm Rodrigo I'm your host and this is daber in
58:54
I'm your host and this is daber in
58:54
I'm your host and this is daber in action see you next Monday
58:56
action see you next Monday
58:56
action see you next Monday [Music]
59:04
[Music]
59:04
[Music] so


