What the State Management Building Block: Dapr in Action - Ep. 4
0 views
Aug 6, 2025
In this episode, you will understand what the State management building block is, what are some of its concrete component implementations 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
View Video Transcript
0:00
e
0:46
hello people from around the world this
0:50
hello people from around the world this
0:50
hello people from around the world this is Rodrigo your host in this Dapper in
0:53
is Rodrigo your host in this Dapper in
0:53
is Rodrigo your host in this Dapper in action
0:54
action
0:54
action Series today is December
0:57
Series today is December
0:57
Series today is December 30 who wants to do things in December
1:03
30 who wants to do things in December
1:03
30 who wants to do things in December 30 uh anyway happy New
1:07
30 uh anyway happy New
1:07
30 uh anyway happy New Year um and let's go ahead and talk
1:11
Year um and let's go ahead and talk
1:11
Year um and let's go ahead and talk about the State Management building
1:14
about the State Management building
1:14
about the State Management building block
1:15
block
1:15
block okay and let me show you my screen
1:42
I'm
1:42
I'm
1:42
I'm sorry some technical glitches
1:46
sorry some technical glitches
1:46
sorry some technical glitches today so let's start this
1:50
today so let's start this
1:50
today so let's start this again hello and welcome to this Dapper
1:54
again hello and welcome to this Dapper
1:54
again hello and welcome to this Dapper in action Series today we're going to
1:56
in action Series today we're going to
1:56
in action Series today we're going to see the State Management building block
1:59
see the State Management building block
1:59
see the State Management building block I'm your host post
2:00
I'm your host post
2:01
I'm your host post Rodrigo and let's go ahead and get
2:04
Rodrigo and let's go ahead and get
2:04
Rodrigo and let's go ahead and get started friends
2:06
started friends
2:06
started friends Okay so we've seen the service ocation
2:11
Okay so we've seen the service ocation
2:11
Okay so we've seen the service ocation build building block and then we saw
2:15
build building block and then we saw
2:15
build building block and then we saw well before that we saw the pops up
2:18
well before that we saw the pops up
2:18
well before that we saw the pops up component and today we're going to see
2:20
component and today we're going to see
2:20
component and today we're going to see the State Management so what in the
2:22
the State Management so what in the
2:23
the State Management so what in the world is the state
2:24
world is the state
2:24
world is the state management so this building block allows
2:27
management so this building block allows
2:27
management so this building block allows you to
2:28
you to
2:28
you to store uh small pieces of code in a uh
2:33
store uh small pieces of code in a uh
2:33
store uh small pieces of code in a uh persistent state right in a persistent
2:36
persistent state right in a persistent
2:36
persistent state right in a persistent storage for instance maybe you want to
2:39
storage for instance maybe you want to
2:39
storage for instance maybe you want to say some kind of temporal thing or some
2:44
say some kind of temporal thing or some
2:44
say some kind of temporal thing or some application
2:45
application
2:45
application settings or cash or what have you right
2:51
settings or cash or what have you right
2:51
settings or cash or what have you right so instead of you know connecting to the
2:55
so instead of you know connecting to the
2:55
so instead of you know connecting to the database or store using its SDK your
3:00
database or store using its SDK your
3:00
database or store using its SDK your connection string you use the Dapper
3:03
connection string you use the Dapper
3:03
connection string you use the Dapper side car and the D Dapper side car is
3:06
side car and the D Dapper side car is
3:06
side car and the D Dapper side car is going to be the
3:08
going to be the
3:08
going to be the one that stores the data in the state
3:11
one that stores the data in the state
3:11
one that stores the data in the state store that is configured for your
3:15
store that is configured for your
3:15
store that is configured for your particular State Management building
3:17
particular State Management building
3:17
particular State Management building block so pretty easy thing to grasp I
3:21
block so pretty easy thing to grasp I
3:21
block so pretty easy thing to grasp I think this is for
3:23
think this is for
3:23
think this is for storing uh small pieces of code this is
3:26
storing uh small pieces of code this is
3:26
storing uh small pieces of code this is not an OM okay this is not not a
3:30
not an OM okay this is not not a
3:30
not an OM okay this is not not a replacement of any
3:33
replacement of any
3:33
replacement of any framework or what have you happy New
3:36
framework or what have you happy New
3:36
framework or what have you happy New Year Rohit my
3:39
Year Rohit my
3:39
Year Rohit my friend um
3:42
friend um
3:42
friend um Bruno
3:43
Bruno
3:43
Bruno hello hello
3:46
hello hello
3:46
hello hello everybody um and there's
3:49
everybody um and there's
3:49
everybody um and there's another another um friend around here
3:54
another another um friend around here
3:54
another another um friend around here roit okay cool so this is not an no RM
3:58
roit okay cool so this is not an no RM
3:58
roit okay cool so this is not an no RM right this is not a replacement of any
4:01
right this is not a replacement of any
4:01
right this is not a replacement of any framework and this is just for
4:05
framework and this is just for
4:05
framework and this is just for storing state right this is not your
4:08
storing state right this is not your
4:08
storing state right this is not your regular tables and primary keys and
4:12
regular tables and primary keys and
4:12
regular tables and primary keys and foreign keys and transactions between
4:16
foreign keys and transactions between
4:16
foreign keys and transactions between tables views store procedures and so on
4:20
tables views store procedures and so on
4:20
tables views store procedures and so on okay this is just for
4:22
okay this is just for
4:22
okay this is just for state and luckily we have dozens of
4:27
state and luckily we have dozens of
4:27
state and luckily we have dozens of different uh State Storage that we can
4:30
different uh State Storage that we can
4:30
different uh State Storage that we can use you know that we have the building
4:32
use you know that we have the building
4:32
use you know that we have the building blocks those are the
4:34
blocks those are the
4:34
blocks those are the abstractions such as the state
4:36
abstractions such as the state
4:36
abstractions such as the state management and we have the concrete
4:38
management and we have the concrete
4:38
management and we have the concrete implementations of those abstractions
4:40
implementations of those abstractions
4:40
implementations of those abstractions such as the you know in this case State
4:43
such as the you know in this case State
4:43
such as the you know in this case State Source we can see that are there are
4:46
Source we can see that are there are
4:46
Source we can see that are there are dozens of different state sours that we
4:49
dozens of different state sours that we
4:49
dozens of different state sours that we can
4:50
can
4:50
can use so this is the official daer
4:54
use so this is the official daer
4:54
use so this is the official daer documentation right we have for Asher we
4:58
documentation right we have for Asher we
4:58
documentation right we have for Asher we have for AWS
5:00
have for AWS
5:00
have for AWS Google Cloud platform and some others
5:04
Google Cloud platform and some others
5:04
Google Cloud platform and some others right some fantastic
5:06
right some fantastic
5:06
right some fantastic Technologies and you have to be aware
5:09
Technologies and you have to be aware
5:09
Technologies and you have to be aware about those features and about the you
5:13
about those features and about the you
5:13
about those features and about the you know the things that those component
5:17
know the things that those component
5:17
know the things that those component support because I'm going to speak about
5:20
support because I'm going to speak about
5:20
support because I'm going to speak about the transactional Out book pattern later
5:24
the transactional Out book pattern later
5:24
the transactional Out book pattern later today and for that pattern you need to
5:27
today and for that pattern you need to
5:27
today and for that pattern you need to support transactional
5:30
support transactional
5:30
support transactional um
5:31
um
5:31
um processes okay anyway we have dozens of
5:35
processes okay anyway we have dozens of
5:35
processes okay anyway we have dozens of different state stores and that's
5:39
different state stores and that's
5:39
different state stores and that's amazing and there are some features
5:41
amazing and there are some features
5:41
amazing and there are some features about this State Management building
5:42
about this State Management building
5:42
about this State Management building block that I want to talk about today
5:45
block that I want to talk about today
5:45
block that I want to talk about today such as configurable metadata this is
5:48
such as configurable metadata this is
5:48
such as configurable metadata this is for you know sometimes of course you're
5:51
for you know sometimes of course you're
5:51
for you know sometimes of course you're using this abstraction and you're using
5:54
using this abstraction and you're using
5:54
using this abstraction and you're using this Common Ground between Technologies
5:57
this Common Ground between Technologies
5:58
this Common Ground between Technologies right but you are using this um the
6:03
right but you are using this um the
6:03
right but you are using this um the common interface between those
6:07
common interface between those
6:07
common interface between those Technologies and sometimes you you need
6:10
Technologies and sometimes you you need
6:10
Technologies and sometimes you you need to use the specific thing about the
6:12
to use the specific thing about the
6:12
to use the specific thing about the technology that you want to use right so
6:16
technology that you want to use right so
6:16
technology that you want to use right so this is fantastic you can use
6:18
this is fantastic you can use
6:18
this is fantastic you can use configurable metadata for using specific
6:21
configurable metadata for using specific
6:21
configurable metadata for using specific things about the concrete
6:23
things about the concrete
6:23
things about the concrete implementation of your State Management
6:26
implementation of your State Management
6:26
implementation of your State Management bu building
6:28
bu building
6:28
bu building block and it supports both strong and
6:31
block and it supports both strong and
6:31
block and it supports both strong and eventual
6:33
eventual
6:33
eventual consistencies and this is important
6:36
consistencies and this is important
6:36
consistencies and this is important since most of the time in distributed
6:38
since most of the time in distributed
6:38
since most of the time in distributed applications you want to embrace and be
6:42
applications you want to embrace and be
6:42
applications you want to embrace and be happy with eventual consistency actually
6:45
happy with eventual consistency actually
6:46
happy with eventual consistency actually I think that is one of the um biggest
6:50
I think that is one of the um biggest
6:50
I think that is one of the um biggest challenges when people start creating
6:53
challenges when people start creating
6:53
challenges when people start creating distributed
6:54
distributed
6:54
distributed applications such as you know
6:57
applications such as you know
6:57
applications such as you know microservices you don't have your
6:59
microservices you don't have your
7:00
microservices you don't have your regular you know select blah blah blah
7:03
regular you know select blah blah blah
7:03
regular you know select blah blah blah from table left join or inner
7:07
from table left join or inner
7:07
from table left join or inner join this other table
7:10
join this other table
7:11
join this other table right
7:12
right
7:12
right so and you don't have um all the data
7:17
so and you don't have um all the data
7:17
so and you don't have um all the data right there in distributed applications
7:19
right there in distributed applications
7:19
right there in distributed applications you have to be happy and you have to
7:21
you have to be happy and you have to
7:21
you have to be happy and you have to embrace eventual consistency and this is
7:25
embrace eventual consistency and this is
7:25
embrace eventual consistency and this is actually the default behavior for the
7:27
actually the default behavior for the
7:27
actually the default behavior for the State Management building block
7:30
State Management building block
7:30
State Management building block and your application should assume a
7:33
and your application should assume a
7:33
and your application should assume a data store is eventually
7:35
data store is eventually
7:35
data store is eventually consistent some data store support
7:40
consistent some data store support
7:40
consistent some data store support synchronous
7:42
synchronous
7:42
synchronous transactions in other words the strong
7:47
transactions in other words the strong
7:47
transactions in other words the strong consistency however I think it's better
7:50
consistency however I think it's better
7:50
consistency however I think it's better to just use eventual consistencies
7:53
to just use eventual consistencies
7:53
to just use eventual consistencies okay you can create your data in other
7:57
okay you can create your data in other
7:57
okay you can create your data in other words you want to store this small piece
8:00
words you want to store this small piece
8:01
words you want to store this small piece of codee or data right this I don't know
8:04
of codee or data right this I don't know
8:04
of codee or data right this I don't know this Json document or what have you
8:06
this Json document or what have you
8:06
this Json document or what have you right and you can encrypt that
8:09
right and you can encrypt that
8:09
right and you can encrypt that information in your state management um
8:12
information in your state management um
8:12
information in your state management um concrete
8:14
concrete
8:14
concrete implementation and another feature which
8:17
implementation and another feature which
8:17
implementation and another feature which is pretty cool is that you can share
8:19
is pretty cool is that you can share
8:20
is pretty cool is that you can share State between
8:21
State between
8:21
State between applications so this is when you have
8:24
applications so this is when you have
8:24
applications so this is when you have application a and application B and both
8:29
application a and application B and both
8:29
application a and application B and both applic s share the same
8:32
applic s share the same
8:32
applic s share the same state so this is useful when you're
8:35
state so this is useful when you're
8:35
state so this is useful when you're building some kind of a you know a suite
8:38
building some kind of a you know a suite
8:38
building some kind of a you know a suite of
8:40
of
8:40
of applications think about Microsoft
8:42
applications think about Microsoft
8:42
applications think about Microsoft Office right there's a share things in
8:47
Office right there's a share things in
8:47
Office right there's a share things in your computer um when you install and
8:50
your computer um when you install and
8:50
your computer um when you install and you run those
8:52
you run those
8:52
you run those applications so you can share this state
8:55
applications so you can share this state
8:55
applications so you can share this state between applications and this is
8:58
between applications and this is
8:58
between applications and this is fantastic so So speaking about
9:01
fantastic so So speaking about
9:01
fantastic so So speaking about consistencies I mentioned strong and
9:05
consistencies I mentioned strong and
9:05
consistencies I mentioned strong and eventual my recommendation is just
9:08
eventual my recommendation is just
9:08
eventual my recommendation is just Embrace eventual consistency and you'll
9:10
Embrace eventual consistency and you'll
9:10
Embrace eventual consistency and you'll be
9:11
be
9:11
be fine and that is actually one of the
9:14
fine and that is actually one of the
9:14
fine and that is actually one of the main requirements when building
9:15
main requirements when building
9:15
main requirements when building distributed applications and you know
9:17
distributed applications and you know
9:17
distributed applications and you know microservices and those kind of uh
9:20
microservices and those kind of uh
9:20
microservices and those kind of uh software
9:21
software
9:21
software architectures so strong consistency in
9:24
architectures so strong consistency in
9:24
architectures so strong consistency in this scenario Dapper waits for all
9:28
this scenario Dapper waits for all
9:28
this scenario Dapper waits for all replicas
9:30
replicas
9:30
replicas to
9:30
to
9:30
to acknowledge before confirming a right
9:34
acknowledge before confirming a right
9:34
acknowledge before confirming a right request on the other hand in the
9:37
request on the other hand in the
9:37
request on the other hand in the eventual consistency scenario Dapper
9:41
eventual consistency scenario Dapper
9:41
eventual consistency scenario Dapper returns as soon as the data store
9:43
returns as soon as the data store
9:43
returns as soon as the data store accepts the right
9:45
accepts the right
9:45
accepts the right request right just a fire and
9:49
request right just a fire and
9:49
request right just a fire and forget just write the thing and that's
9:52
forget just write the thing and that's
9:52
forget just write the thing and that's it
9:53
it
9:53
it eventually data the data will be
9:57
eventually data the data will be
9:57
eventually data the data will be consistent right and of course you have
9:59
consistent right and of course you have
9:59
consistent right and of course you have to do some other things when building
10:02
to do some other things when building
10:02
to do some other things when building these kind of uh
10:05
these kind of uh
10:05
these kind of uh scenarios um but I think it's great for
10:08
scenarios um but I think it's great for
10:08
scenarios um but I think it's great for scalability and for performance when
10:11
scalability and for performance when
10:11
scalability and for performance when building this this kind of
10:15
building this this kind of
10:15
building this this kind of solutions okay shared State I mentioned
10:17
solutions okay shared State I mentioned
10:17
solutions okay shared State I mentioned be this before this enables you to
10:21
be this before this enables you to
10:21
be this before this enables you to isolate the state well you have
10:23
isolate the state well you have
10:24
isolate the state well you have different scenarios right one option is
10:27
different scenarios right one option is
10:27
different scenarios right one option is just have a state for your specific
10:29
just have a state for your specific
10:29
just have a state for your specific application this is the first option
10:32
application this is the first option
10:32
application this is the first option that we have here hey deac how are you
10:36
that we have here hey deac how are you
10:36
that we have here hey deac how are you brother and the other option is just
10:39
brother and the other option is just
10:39
brother and the other option is just share the state between
10:42
share the state between
10:42
share the state between applications and this third option
10:44
applications and this third option
10:44
applications and this third option allows you to share the the the the the
10:49
allows you to share the the the the the
10:49
allows you to share the the the the the state store uh between multiple apps in
10:54
state store uh between multiple apps in
10:54
state store uh between multiple apps in different state
10:56
different state
10:56
different state stores so I think this is just a
10:59
stores so I think this is just a
10:59
stores so I think this is just a uh different implementation of the
11:02
uh different implementation of the
11:02
uh different implementation of the second option
11:04
second option
11:04
second option right so in other words you can start
11:07
right so in other words you can start
11:07
right so in other words you can start state for your specific application or
11:09
state for your specific application or
11:09
state for your specific application or you can share the state basically that's
11:11
you can share the state basically that's
11:11
you can share the state basically that's it okay fantastic let's see how this
11:16
it okay fantastic let's see how this
11:16
it okay fantastic let's see how this works okay and before I go further
11:22
works okay and before I go further
11:22
works okay and before I go further today uh theer in action you might
11:26
today uh theer in action you might
11:26
today uh theer in action you might remember that we were talking about the
11:29
remember that we were talking about the
11:29
remember that we were talking about the service to service ination the other day
11:32
service to service ination the other day
11:32
service to service ination the other day and
11:34
and
11:34
and somehow things didn't work as expected
11:38
somehow things didn't work as expected
11:38
somehow things didn't work as expected at the end of the
11:39
at the end of the
11:39
at the end of the video and that was because I
11:45
video and that was because I
11:45
video and that was because I pasted uh shamelessly the code from you
11:50
pasted uh shamelessly the code from you
11:50
pasted uh shamelessly the code from you know the
11:52
know the
11:52
know the documentation and I didn't change things
11:55
documentation and I didn't change things
11:56
documentation and I didn't change things correctly so this is for the service to
11:59
correctly so this is for the service to
11:59
correctly so this is for the service to service invocation thing right we have
12:02
service invocation thing right we have
12:02
service invocation thing right we have this
12:04
this
12:04
this resiliency
12:06
resiliency
12:06
resiliency policy
12:08
policy
12:08
policy and I had an incorrect name here you
12:12
and I had an incorrect name here you
12:12
and I had an incorrect name here you have to specify the scope where this
12:15
have to specify the scope where this
12:15
have to specify the scope where this policy can be
12:17
policy can be
12:18
policy can be implemented okay so in other words you
12:21
implemented okay so in other words you
12:21
implemented okay so in other words you need to specify the scope in this case
12:23
need to specify the scope in this case
12:23
need to specify the scope in this case is just for this specific service
12:25
is just for this specific service
12:25
is just for this specific service service a and then you specify the
12:28
service a and then you specify the
12:28
service a and then you specify the policies
12:29
policies
12:29
policies in this case retry with a name and then
12:33
in this case retry with a name and then
12:33
in this case retry with a name and then circuit breaker with a specific name and
12:36
circuit breaker with a specific name and
12:36
circuit breaker with a specific name and the behavior that you want to use and
12:40
the behavior that you want to use and
12:40
the behavior that you want to use and then you specify the
12:42
then you specify the
12:42
then you specify the targets right and that was missing from
12:46
targets right and that was missing from
12:47
targets right and that was missing from the last
12:48
the last
12:48
the last video
12:49
video
12:49
video okay so I totally recommend to you go
12:53
okay so I totally recommend to you go
12:53
okay so I totally recommend to you go back in time and watch the previous
12:57
back in time and watch the previous
12:57
back in time and watch the previous episode and I discussed the service
13:02
episode and I discussed the service
13:02
episode and I discussed the service service to service invocation building
13:03
service to service invocation building
13:03
service to service invocation building block and this is the resiliency policy
13:06
block and this is the resiliency policy
13:06
block and this is the resiliency policy and this is actually the fix that was
13:10
and this is actually the fix that was
13:10
and this is actually the fix that was needed last week
13:14
needed last week
13:14
needed last week okay okay so far so good today we're
13:17
okay okay so far so good today we're
13:18
okay okay so far so good today we're gonna uh talk about State Management so
13:22
gonna uh talk about State Management so
13:22
gonna uh talk about State Management so net
13:23
net
13:23
net new I don't know is that a web API let's
13:28
new I don't know is that a web API let's
13:28
new I don't know is that a web API let's create a new folder
13:30
create a new folder
13:30
create a new folder State just State okay net new web API
13:36
State just State okay net new web API
13:36
State just State okay net new web API and let's name it
13:40
Service uh let's name this
13:45
Service uh let's name this
13:45
Service uh let's name this H is this n and then service a okay so
13:52
H is this n and then service a okay so
13:52
H is this n and then service a okay so let me see we want to create a web API
13:55
let me see we want to create a web API
13:55
let me see we want to create a web API and we need to add the net package as
14:00
and we need to add the net package as
14:00
and we need to add the net package as Dapper in the Middle where you know in
14:02
Dapper in the Middle where you know in
14:02
Dapper in the Middle where you know in the pipeline in
14:05
the pipeline in
14:05
the pipeline in program.cs uh this
14:08
program.cs uh this
14:08
program.cs uh this is uh and then we need to inject uper
14:13
is uh and then we need to inject uper
14:13
is uh and then we need to inject uper client somewhere maybe in the
14:16
client somewhere maybe in the
14:16
client somewhere maybe in the controller and then we need to use the
14:19
controller and then we need to use the
14:19
controller and then we need to use the the specific component in this case you
14:22
the specific component in this case you
14:22
the specific component in this case you might remember that we have
14:26
might remember that we have
14:26
might remember that we have here do dapper right right components
14:31
here do dapper right right components
14:31
here do dapper right right components and we have something named state
14:34
and we have something named state
14:34
and we have something named state store this is the you know the default
14:38
store this is the you know the default
14:38
store this is the you know the default state store
14:40
state store
14:40
state store configuration that Dapper installs in
14:44
configuration that Dapper installs in
14:44
configuration that Dapper installs in your machine when you initialize Dapper
14:47
your machine when you initialize Dapper
14:47
your machine when you initialize Dapper so in other words for state store this
14:50
so in other words for state store this
14:50
so in other words for state store this is going to use redis as you can see
14:52
is going to use redis as you can see
14:53
is going to use redis as you can see here on the screen and it's going to
14:55
here on the screen and it's going to
14:55
here on the screen and it's going to connect to the
14:57
connect to the
14:57
connect to the local r container that is running on in
15:01
local r container that is running on in
15:01
local r container that is running on in Docker right Docker
15:03
Docker right Docker
15:03
Docker right Docker PS and you can see that I
15:06
PS and you can see that I
15:06
PS and you can see that I have right
15:08
have right
15:09
have right here
15:10
here
15:10
here theer where is it this one radi is this
15:15
theer where is it this one radi is this
15:15
theer where is it this one radi is this is the container image and this is
15:18
is the container image and this is
15:18
is the container image and this is running in Port 6 through3
15:22
running in Port 6 through3
15:22
running in Port 6 through3 79 right because I have another radius
15:25
79 right because I have another radius
15:25
79 right because I have another radius for other things that I've been
15:27
for other things that I've been
15:27
for other things that I've been using ER
15:29
using ER
15:29
using ER this is another different Rus but I
15:32
this is another different Rus but I
15:32
this is another different Rus but I actually can use that one as well anyway
15:36
actually can use that one as well anyway
15:36
actually can use that one as well anyway as you can see this is the default
15:38
as you can see this is the default
15:38
as you can see this is the default configuration C state store Jamel and
15:42
configuration C state store Jamel and
15:42
configuration C state store Jamel and this is the configuration that is going
15:44
this is the configuration that is going
15:44
this is the configuration that is going to be used when using the State
15:47
to be used when using the State
15:47
to be used when using the State Management building
15:48
Management building
15:48
Management building block so let's go back to diaper in
15:51
block so let's go back to diaper in
15:51
block so let's go back to diaper in action State net new web API my service
15:57
action State net new web API my service
15:57
action State net new web API my service okay just a regular my
16:02
okay just a regular my
16:02
okay just a regular my service
16:04
service
16:04
service okay
16:05
okay
16:05
okay and please allow me to go here to this
16:11
and please allow me to go here to this
16:11
and please allow me to go here to this other instance of Visual Studio please
16:13
other instance of Visual Studio please
16:13
other instance of Visual Studio please bear with
16:14
bear with
16:14
bear with me and I'm going
16:17
me and I'm going
16:17
me and I'm going to
16:21
open my
16:23
open my
16:23
open my service and I want to create a new
16:26
service and I want to create a new
16:26
service and I want to create a new solution net new
16:29
solution net new
16:29
solution net new solution and this is going to be State
16:33
solution and this is going to be State
16:33
solution and this is going to be State Management oh net New State
16:37
Management oh net New State
16:37
Management oh net New State Management okay and let's delete this
16:41
Management okay and let's delete this
16:41
Management okay and let's delete this one and Net Solution add my service and
16:45
one and Net Solution add my service and
16:45
one and Net Solution add my service and I think that's it let's go in this other
16:50
I think that's it let's go in this other
16:51
I think that's it let's go in this other monitor I'm going to open State
16:53
monitor I'm going to open State
16:53
monitor I'm going to open State Management that is right here
16:56
Management that is right here
16:56
Management that is right here okay so far so good
17:00
okay so far so good
17:00
okay so far so good so yes nuget packages remember that
17:05
so yes nuget packages remember that
17:05
so yes nuget packages remember that Dapper exposes an API right and you can
17:08
Dapper exposes an API right and you can
17:08
Dapper exposes an API right and you can just use an HTTP client object and then
17:11
just use an HTTP client object and then
17:11
just use an HTTP client object and then send some
17:12
send some
17:12
send some requests and receive the
17:15
requests and receive the
17:15
requests and receive the responses but I believe that's not real
17:18
responses but I believe that's not real
17:18
responses but I believe that's not real world most of the time you want to use
17:20
world most of the time you want to use
17:20
world most of the time you want to use the official
17:22
the official
17:22
the official sdks depending on your programming
17:25
sdks depending on your programming
17:25
sdks depending on your programming language that you're using right anyway
17:29
language that you're using right anyway
17:29
language that you're using right anyway way I'm using net 9 and and this is
17:33
way I'm using net 9 and and this is
17:33
way I'm using net 9 and and this is because net 9 in net is fantastic right
17:38
because net 9 in net is fantastic right
17:38
because net 9 in net is fantastic right so let's use dopper asp.net core this is
17:42
so let's use dopper asp.net core this is
17:42
so let's use dopper asp.net core this is the net package that I want to use and
17:46
the net package that I want to use and
17:46
the net package that I want to use and then be aware that this is going to add
17:49
then be aware that this is going to add
17:49
then be aware that this is going to add this package
17:50
this package
17:50
this package reference right here today the latest
17:54
reference right here today the latest
17:54
reference right here today the latest version of dapper is
17:56
version of dapper is
17:56
version of dapper is 1.14 but I think
17:59
1.14 but I think
17:59
1.14 but I think next week is going to be released the
18:01
next week is going to be released the
18:01
next week is going to be released the next version of dapper which is
18:05
next version of dapper which is
18:05
next version of dapper which is 1.15
18:06
1.15
18:06
1.15 anyway um this is great and
18:10
anyway um this is great and
18:10
anyway um this is great and then so we need to add Dapper right so
18:14
then so we need to add Dapper right so
18:15
then so we need to add Dapper right so something like Builder Services add
18:19
something like Builder Services add
18:19
something like Builder Services add dopper right is this
18:22
dopper right is this
18:22
dopper right is this one no or is it I I'm using you know
18:27
one no or is it I I'm using you know
18:28
one no or is it I I'm using you know what I'm using
18:31
um um minimal web apis but I'm not a fan
18:35
um um minimal web apis but I'm not a fan
18:35
um um minimal web apis but I'm not a fan of this so let
18:39
of this so let
18:39
of this so let me uh add
18:41
me uh add
18:41
me uh add another asp.net core web
18:45
another asp.net core web
18:45
another asp.net core web API and D action State my service I know
18:50
API and D action State my service I know
18:50
API and D action State my service I know my State service this is going to be the
18:54
my State service this is going to be the
18:54
my State service this is going to be the new name my state service and use
18:57
new name my state service and use
18:57
new name my state service and use controllers and I think that's it
19:00
controllers and I think that's it
19:00
controllers and I think that's it not a fan of web
19:02
not a fan of web
19:03
not a fan of web apis uh okay let's go ahead and do the
19:05
apis uh okay let's go ahead and do the
19:05
apis uh okay let's go ahead and do the same however I'm just going to copy this
19:09
same however I'm just going to copy this
19:09
same however I'm just going to copy this and let's go back here to the Cs Pro
19:12
and let's go back here to the Cs Pro
19:12
and let's go back here to the Cs Pro File add the package reference I think
19:15
File add the package reference I think
19:15
File add the package reference I think that's it and here I can go ahead and
19:21
that's it and here I can go ahead and
19:21
that's it and here I can go ahead and add dopper
19:23
add dopper
19:23
add dopper right and we have the
19:25
right and we have the
19:25
right and we have the controllers I have weather forecast
19:28
controllers I have weather forecast
19:28
controllers I have weather forecast controller
19:29
controller
19:29
controller right so let's reuse this
19:33
right so let's reuse this
19:33
right so let's reuse this okay uh somehow this is just you know
19:38
okay uh somehow this is just you know
19:38
okay uh somehow this is just you know returning fictitious weather
19:42
returning fictitious weather
19:42
returning fictitious weather information and I can go ahead and
19:46
information and I can go ahead and
19:46
information and I can go ahead and let's you know what let me change the
19:49
let's you know what let me change the
19:49
let's you know what let me change the name of
19:50
name of
19:50
name of this I don't want to reuse
19:53
this I don't want to reuse
19:53
this I don't want to reuse this uh sometimes it's very difficult to
19:57
this uh sometimes it's very difficult to
19:57
this uh sometimes it's very difficult to reuse this uh information which is just
20:00
reuse this uh information which is just
20:00
reuse this uh information which is just a placeholder for your own
20:02
a placeholder for your own
20:02
a placeholder for your own implementation of things anyway State
20:06
implementation of things anyway State
20:06
implementation of things anyway State Controller API controller so far so good
20:10
Controller API controller so far so good
20:10
Controller API controller so far so good going to use the primary Constructor
20:11
going to use the primary Constructor
20:11
going to use the primary Constructor syntax dopper client right this is just
20:15
syntax dopper client right this is just
20:15
syntax dopper client right this is just a
20:16
a
20:16
a regular pattern that I'm repeating
20:18
regular pattern that I'm repeating
20:18
regular pattern that I'm repeating throughout the this course Right add
20:22
throughout the this course Right add
20:22
throughout the this course Right add dopper you know the N package register
20:25
dopper you know the N package register
20:25
dopper you know the N package register dopper inject dopper client and use it
20:29
dopper inject dopper client and use it
20:29
dopper inject dopper client and use it this is your um this object
20:33
this is your um this object
20:33
this is your um this object encapsulates all the you know
20:35
encapsulates all the you know
20:35
encapsulates all the you know communication to the dopper API so it's
20:40
communication to the dopper API so it's
20:40
communication to the dopper API so it's great so public ising I don't know is
20:43
great so public ising I don't know is
20:43
great so public ising I don't know is this I action result I'm gonna I'm gonna
20:48
this I action result I'm gonna I'm gonna
20:48
this I action result I'm gonna I'm gonna use
20:49
use
20:49
use this um so I don't know
20:53
this um so I don't know
20:53
this um so I don't know add
20:55
add
20:55
add right so I just want to use HT TTP post
20:59
right so I just want to use HT TTP post
20:59
right so I just want to use HT TTP post or something I just want to add some
21:02
or something I just want to add some
21:02
or something I just want to add some kind of state I just want to show you
21:04
kind of state I just want to show you
21:04
kind of state I just want to show you this friends D client Dot and check this
21:08
this friends D client Dot and check this
21:08
this friends D client Dot and check this out okay so let's see all of those
21:13
out okay so let's see all of those
21:13
out okay so let's see all of those methods that we have for saving State
21:17
methods that we have for saving State
21:17
methods that we have for saving State Save State acing save bulk State acing
21:22
Save State acing save bulk State acing
21:22
Save State acing save bulk State acing query the state this is when you have
21:24
query the state this is when you have
21:24
query the state this is when you have different uh State values stored
21:29
different uh State values stored
21:29
different uh State values stored and then you want to you know
21:31
and then you want to you know
21:31
and then you want to you know retrieve a particular state by using a
21:34
retrieve a particular state by using a
21:34
retrieve a particular state by using a query
21:35
query
21:35
query syntax and you know this is just for CR
21:40
syntax and you know this is just for CR
21:40
syntax and you know this is just for CR right create read update and delete the
21:44
right create read update and delete the
21:44
right create read update and delete the state there's nothing um fancy about
21:48
state there's nothing um fancy about
21:48
state there's nothing um fancy about this right so this is this one is a nice
21:52
this right so this is this one is a nice
21:52
this right so this is this one is a nice try safe State since it's going to
21:54
try safe State since it's going to
21:54
try safe State since it's going to return
21:56
return
21:56
return bull if the value was stored
22:01
bull if the value was stored
22:01
bull if the value was stored successfully so I think this one is uh
22:03
successfully so I think this one is uh
22:04
successfully so I think this one is uh pretty
22:04
pretty
22:04
pretty compelling and otherwise we have Save
22:08
compelling and otherwise we have Save
22:08
compelling and otherwise we have Save State and you can see that this is a
22:10
State and you can see that this is a
22:10
State and you can see that this is a generic
22:12
generic
22:12
generic method in other words you can have a
22:14
method in other words you can have a
22:14
method in other words you can have a model class or record and then store
22:18
model class or record and then store
22:18
model class or record and then store that particular object in your state
22:22
that particular object in your state
22:22
that particular object in your state store which is
22:25
store which is
22:25
store which is fantastic
22:27
fantastic
22:27
fantastic abishek will it be available afterwards
22:30
abishek will it be available afterwards
22:30
abishek will it be available afterwards yes of course you can go ahead and
22:34
yes of course you can go ahead and
22:34
yes of course you can go ahead and navigate to
22:36
navigate to
22:36
navigate to c.com that's the latest and greatest
22:40
c.com that's the latest and greatest
22:40
c.com that's the latest and greatest version of C
22:43
version of C
22:43
version of C Corner um in the
22:47
Corner um in the
22:47
Corner um in the internet so you can go there and find
22:50
internet so you can go there and find
22:50
internet so you can go there and find the you know the other episodes this is
22:53
the you know the other episodes this is
22:53
the you know the other episodes this is the fourth episode that we're um the in
22:59
the fourth episode that we're um the in
22:59
the fourth episode that we're um the in okay anyway Save State or this other one
23:04
okay anyway Save State or this other one
23:04
okay anyway Save State or this other one I think you get it
23:07
I think you get it
23:07
I think you get it right this is pretty easy
23:10
right this is pretty easy
23:10
right this is pretty easy stuff so for instance you have to
23:13
stuff so for instance you have to
23:13
stuff so for instance you have to specify the store
23:14
specify the store
23:15
specify the store name this is this
23:18
name this is this
23:18
name this is this one let me go back here do doer do
23:24
one let me go back here do doer do
23:24
one let me go back here do doer do components I'm sorry not DOT components
23:26
components I'm sorry not DOT components
23:26
components I'm sorry not DOT components but just components and then state store
23:31
but just components and then state store
23:31
but just components and then state store and this is the name okay the name
23:36
and this is the name okay the name
23:36
and this is the name okay the name element that is inside
23:39
element that is inside
23:39
element that is inside metadata so you might remember if you
23:41
metadata so you might remember if you
23:41
metadata so you might remember if you are a kubernetes
23:43
are a kubernetes
23:43
are a kubernetes developer or admin you know that most of
23:47
developer or admin you know that most of
23:47
developer or admin you know that most of the time we have API version kind
23:50
the time we have API version kind
23:50
the time we have API version kind metadata in Spec and that name inside
23:54
metadata in Spec and that name inside
23:54
metadata in Spec and that name inside metadata is the technical name that you
23:57
metadata is the technical name that you
23:57
metadata is the technical name that you can refer comped to when building this
24:01
can refer comped to when building this
24:01
can refer comped to when building this kind of uh
24:02
kind of uh
24:02
kind of uh Solutions in other words state store
24:07
Solutions in other words state store
24:07
Solutions in other words state store state store right that's the name you
24:10
state store right that's the name you
24:11
state store right that's the name you are telling Dapper this Dapper client
24:13
are telling Dapper this Dapper client
24:13
are telling Dapper this Dapper client object hey you know what I want to use
24:15
object hey you know what I want to use
24:15
object hey you know what I want to use that
24:16
that
24:16
that component because of course I can have
24:19
component because of course I can have
24:20
component because of course I can have other Jam file for other state store
24:25
other Jam file for other state store
24:25
other Jam file for other state store with a different
24:26
with a different
24:26
with a different name say
24:28
name say
24:28
name say Spider-Man and that's fine okay in that
24:32
Spider-Man and that's fine okay in that
24:32
Spider-Man and that's fine okay in that case you need to change the name there
24:35
case you need to change the name there
24:35
case you need to change the name there and use that other state store component
24:40
and use that other state store component
24:40
and use that other state store component okay and then just a as a regular
24:43
okay and then just a as a regular
24:43
okay and then just a as a regular dictionary this is just a key value pair
24:46
dictionary this is just a key value pair
24:46
dictionary this is just a key value pair store right so you have to specify the
24:51
store right so you have to specify the
24:51
store right so you have to specify the key and then the
24:53
key and then the
24:53
key and then the value so for instance I don't know I
24:56
value so for instance I don't know I
24:56
value so for instance I don't know I want to store a string
24:58
want to store a string
24:58
want to store a string and then the key is going to be hello
25:02
and then the key is going to be hello
25:02
and then the key is going to be hello right and value is
25:04
right and value is
25:04
right and value is world so far so good and I can do this
25:09
world so far so good and I can do this
25:09
world so far so good and I can do this right
25:11
right
25:11
right and what else I can I need to specify
25:14
and what else I can I need to specify
25:14
and what else I can I need to specify the E tag in this particular tricep
25:18
the E tag in this particular tricep
25:18
the E tag in this particular tricep state
25:19
state
25:19
state asnc so this is requiring the E
25:22
asnc so this is requiring the E
25:22
asnc so this is requiring the E tag or you can just use Save State async
25:28
tag or you can just use Save State async
25:28
tag or you can just use Save State async and I think that's it that's it and of
25:32
and I think that's it that's it and of
25:32
and I think that's it that's it and of course this is inferring that I'm using
25:35
course this is inferring that I'm using
25:35
course this is inferring that I'm using an string
25:37
an string
25:37
an string right so I can do this and return okay
25:42
right so I can do this and return okay
25:42
right so I can do this and return okay and everyone is happy right stay T key
25:47
and everyone is happy right stay T key
25:47
and everyone is happy right stay T key and value and that's it of course you
25:49
and value and that's it of course you
25:49
and value and that's it of course you can use I don't know maybe some kind of
25:52
can use I don't know maybe some kind of
25:53
can use I don't know maybe some kind of uh
25:54
uh
25:54
uh complex implementation of the of a model
25:57
complex implementation of the of a model
25:57
complex implementation of the of a model class right
25:59
class right
25:59
class right such as I don't know this state
26:03
such as I don't know this state
26:03
such as I don't know this state record and of course you need in this
26:05
record and of course you need in this
26:06
record and of course you need in this case you need to use state
26:08
case you need to use state
26:08
case you need to use state record right
26:11
record right
26:11
record right anyway this state record and then
26:14
anyway this state record and then
26:14
anyway this state record and then specify the values here and you know you
26:18
specify the values here and you know you
26:18
specify the values here and you know you get it this is just
26:20
get it this is just
26:20
get it this is just a like a dictionary right pretty easy
26:25
a like a dictionary right pretty easy
26:25
a like a dictionary right pretty easy stuff so this is for for saving the
26:29
stuff so this is for for saving the
26:29
stuff so this is for for saving the state and for obtaining the state of
26:32
state and for obtaining the state of
26:32
state and for obtaining the state of course you need to use those um you know
26:37
course you need to use those um you know
26:37
course you need to use those um you know dopper
26:37
dopper
26:38
dopper client State and there's one named get
26:42
client State and there's one named get
26:42
client State and there's one named get State there's another one gate State and
26:46
State there's another one gate State and
26:46
State there's another one gate State and E tag right so I think this one is
26:51
E tag right so I think this one is
26:51
E tag right so I think this one is pretty compelling so you need to to
26:53
pretty compelling so you need to to
26:53
pretty compelling so you need to to specify the store name again and finally
26:57
specify the store name again and finally
26:57
specify the store name again and finally the you you know the key and that's it
27:01
the you you know the key and that's it
27:01
the you you know the key and that's it hello right so y result equals wait this
27:07
hello right so y result equals wait this
27:07
hello right so y result equals wait this um line of code and get State and is
27:11
um line of code and get State and is
27:11
um line of code and get State and is there something
27:13
there something
27:13
there something missing uh get State I think that's
27:17
missing uh get State I think that's
27:17
missing uh get State I think that's it right the type Arguments for
27:22
it right the type Arguments for
27:22
it right the type Arguments for method uh so there's something else that
27:25
method uh so there's something else that
27:25
method uh so there's something else that is needed
27:26
is needed
27:26
is needed here um
27:29
here um
27:29
here um consistency mode cancellation
27:32
consistency mode cancellation
27:32
consistency mode cancellation token uh so it looks like store
27:36
token uh so it looks like store
27:36
token uh so it looks like store name and then
27:41
key oh something is missing
27:45
key oh something is missing
27:45
key oh something is missing here and result and that's it so in this
27:50
here and result and that's it so in this
27:50
here and result and that's it so in this case I want to use this generic
27:53
case I want to use this generic
27:53
case I want to use this generic implementation or syntax of get State
27:56
implementation or syntax of get State
27:57
implementation or syntax of get State okay cool and I think those two are not
27:59
okay cool and I think those two are not
27:59
okay cool and I think those two are not required anymore um
28:03
required anymore um
28:03
required anymore um right okay cool save State get the state
28:07
right okay cool save State get the state
28:07
right okay cool save State get the state a lot of different methods that we have
28:08
a lot of different methods that we have
28:08
a lot of different methods that we have in the SDK you have to specify the state
28:11
in the SDK you have to specify the state
28:11
in the SDK you have to specify the state store name and basically that's it okay
28:15
store name and basically that's it okay
28:15
store name and basically that's it okay Dapper is gonna be the one responsible
28:19
Dapper is gonna be the one responsible
28:19
Dapper is gonna be the one responsible for doing the magic okay let's go back
28:23
for doing the magic okay let's go back
28:23
for doing the magic okay let's go back to the terminal and see how this works
28:26
to the terminal and see how this works
28:26
to the terminal and see how this works let's go back here
28:28
let's go back here
28:28
let's go back here and you know net
28:31
and you know net
28:31
and you know net build this my state
28:34
build this my state
28:34
build this my state service and
28:36
service and
28:36
service and then um you know what uh Net Solution
28:41
then um you know what uh Net Solution
28:41
then um you know what uh Net Solution remove my service and then remove my
28:46
remove my service and then remove my
28:46
remove my service and then remove my service
28:47
service
28:47
service Force baa byy okay cool my state service
28:52
Force baa byy okay cool my state service
28:52
Force baa byy okay cool my state service and then do build just a
28:56
and then do build just a
28:56
and then do build just a regular um build
29:00
regular um build
29:00
regular um build command and now we need to
29:04
command and now we need to
29:04
command and now we need to run right we need to run the Dapper side
29:07
run right we need to run the Dapper side
29:07
run right we need to run the Dapper side card dopper run right and Dapper HTTP
29:14
card dopper run right and Dapper HTTP
29:14
card dopper run right and Dapper HTTP Port let's say
29:16
Port let's say
29:16
Port let's say 55,000 and a port let's say I don't know
29:21
55,000 and a port let's say I don't know
29:21
55,000 and a port let's say I don't know 55 0
29:23
55 0
29:23
55 0 0 and I think that's it net wrong
29:29
0 and I think that's it net wrong
29:29
0 and I think that's it net wrong and then URLs and
29:32
and then URLs and
29:32
and then URLs and HTTP and
29:35
HTTP and
29:35
HTTP and plus
29:38
55 is this working as
29:43
expected let's see okay so this is
29:48
expected let's see okay so this is
29:48
expected let's see okay so this is running I'm specifying some Flags in the
29:50
running I'm specifying some Flags in the
29:50
running I'm specifying some Flags in the dopper Run
29:52
dopper Run
29:52
dopper Run command and so let's go ahead and open I
29:57
command and so let's go ahead and open I
29:57
command and so let's go ahead and open I think we can open up
30:01
poan and
30:03
poan and
30:03
poan and let's go back here to visual
30:07
let's go back here to visual
30:07
let's go back here to visual studio right
30:10
studio right
30:10
studio right here uh yeah yeah yeah save as discard I
30:14
here uh yeah yeah yeah save as discard I
30:14
here uh yeah yeah yeah save as discard I think we can discard
30:17
think we can discard
30:17
think we can discard this okay and I'm actually not debugging
30:22
this okay and I'm actually not debugging
30:22
this okay and I'm actually not debugging anyway let's go here and post this local
30:28
anyway let's go here and post this local
30:28
anyway let's go here and post this local host
30:31
host
30:31
host 5500 and
30:34
5500 and
30:34
5500 and state and I think that's it I'm not
30:36
state and I think that's it I'm not
30:36
state and I think that's it I'm not passing any kind of body right I'm just
30:41
passing any kind of body right I'm just
30:41
passing any kind of body right I'm just using that and so this is working this
30:44
using that and so this is working this
30:45
using that and so this is working this is returning 200 nothing fancy right
30:50
is returning 200 nothing fancy right
30:50
is returning 200 nothing fancy right and let's go
30:53
and let's go
30:53
and let's go ahead and
30:56
ahead and
30:56
ahead and open uh radius
30:58
open uh radius
30:59
open uh radius Commander
31:00
Commander
31:00
Commander radius radius
31:03
radius radius
31:03
radius radius Commander right so this is going to
31:07
Commander right so this is going to
31:07
Commander right so this is going to connect to I don't want this particular
31:10
connect to I don't want this particular
31:10
connect to I don't want this particular radius
31:12
radius
31:12
radius connection remember what I told you I'm
31:15
connection remember what I told you I'm
31:15
connection remember what I told you I'm using two different
31:17
using two different
31:17
using two different red uh containers in this
31:20
red uh containers in this
31:20
red uh containers in this computer so R Commander R
31:25
computer so R Commander R
31:25
computer so R Commander R Port is that 6 3
31:31
Port is that 6 3
31:31
Port is that 6 3 79 right I think that is
31:35
79 right I think that is
31:35
79 right I think that is it um so I can before I do this I can
31:42
it um so I can before I do this I can
31:42
it um so I can before I do this I can verify the port which is this one
31:47
6379
31:49
6379
31:49
6379 okay now I'm connected to that
31:52
okay now I'm connected to that
31:52
okay now I'm connected to that particular instance right is connection
31:54
particular instance right is connection
31:54
particular instance right is connection Local Host
31:56
Local Host
31:56
Local Host yes so it looks like this R is Commander
32:01
yes so it looks like this R is Commander
32:01
yes so it looks like this R is Commander allows me to connect to two different
32:04
allows me to connect to two different
32:04
allows me to connect to two different instances at the same time which is
32:06
instances at the same time which is
32:06
instances at the same time which is fantastic can you see
32:09
fantastic can you see
32:09
fantastic can you see this 63
32:12
this 63
32:12
this 63 79 okay
32:14
79 okay
32:14
79 okay cool there is
32:17
cool there is
32:17
cool there is it right
32:19
it right
32:19
it right world this is the key right and this is
32:24
world this is the key right and this is
32:24
world this is the key right and this is the value key and value right
32:28
the value key and value right
32:28
the value key and value right and this is just a random name that R is
32:32
and this is just a random name that R is
32:33
and this is just a random name that R is used for you know for storing this key
32:38
used for you know for storing this key
32:38
used for you know for storing this key so hello and world and we can see that
32:40
so hello and world and we can see that
32:40
so hello and world and we can see that this is working as
32:42
this is working as
32:42
this is working as expected and if I go
32:46
expected and if I go
32:46
expected and if I go here let's duplicate this and instead of
32:49
here let's duplicate this and instead of
32:50
here let's duplicate this and instead of get post let's use
32:53
get post let's use
32:53
get post let's use get and I think that is it so this is
32:56
get and I think that is it so this is
32:56
get and I think that is it so this is returning world right so I'm storing the
33:00
returning world right so I'm storing the
33:00
returning world right so I'm storing the state um quite easy right quite easy
33:05
state um quite easy right quite easy
33:05
state um quite easy right quite easy thing to do and I think we can go ahead
33:11
thing to do and I think we can go ahead
33:11
thing to do and I think we can go ahead and let me show you
33:13
and let me show you
33:13
and let me show you another
33:17
option so let me
33:20
option so let me
33:20
option so let me think what's going on here right we have
33:24
think what's going on here right we have
33:24
think what's going on here right we have States four
33:28
okay this is State four
33:31
okay this is State four
33:31
okay this is State four right I'm going to use this one
33:35
right I'm going to use this one
33:35
right I'm going to use this one since
33:37
since
33:37
since here I want to create a new
33:41
here I want to create a new
33:41
here I want to create a new folder and let's create a new state
33:44
folder and let's create a new state
33:45
folder and let's create a new state store.
33:47
store.
33:47
store. jaml and I'm going to paste
33:51
jaml and I'm going to paste
33:51
jaml and I'm going to paste this okay this is the
33:55
contents right but instead of using
33:59
contents right but instead of using
33:59
contents right but instead of using 6379 I want to use this other one
34:04
6379 I want to use this other one
34:04
6379 I want to use this other one 64
34:06
64
34:06
64 79 since I want to use another different
34:10
79 since I want to use another different
34:10
79 since I want to use another different component right let's think that we
34:14
component right let's think that we
34:14
component right let's think that we don't want to use the default
34:16
don't want to use the default
34:16
don't want to use the default configuration that Dapper
34:19
configuration that Dapper
34:19
configuration that Dapper initializes right so in this case I'm
34:23
initializes right so in this case I'm
34:23
initializes right so in this case I'm creating
34:24
creating
34:24
creating another different component
34:28
another different component
34:28
another different component this other Jam file inside my
34:31
this other Jam file inside my
34:31
this other Jam file inside my application folder in my
34:33
application folder in my
34:33
application folder in my repo and I'm in specifying hey you know
34:36
repo and I'm in specifying hey you know
34:36
repo and I'm in specifying hey you know what I want I want to connect to this
34:38
what I want I want to connect to this
34:38
what I want I want to connect to this other
34:39
other
34:39
other instance
34:41
instance
34:41
instance right or let's say that you want to
34:43
right or let's say that you want to
34:43
right or let's say that you want to don't want to use Rus at all maybe you
34:46
don't want to use Rus at all maybe you
34:46
don't want to use Rus at all maybe you want to use I don't
34:48
want to use I don't
34:48
want to use I don't know sqlite right
34:52
know sqlite right
34:52
know sqlite right postgress or Asher or what have
34:57
postgress or Asher or what have
34:57
postgress or Asher or what have you
34:59
you
34:59
you right so you you want to go to your
35:03
right so you you want to go to your
35:03
right so you you want to go to your particular technology that you want to
35:06
particular technology that you want to
35:06
particular technology that you want to use and then you need to use the
35:11
use and then you need to use the
35:11
use and then you need to use the spec for that
35:13
spec for that
35:13
spec for that particular uh
35:15
particular uh
35:15
particular uh technology so for example let's say that
35:19
technology so for example let's say that
35:19
technology so for example let's say that I don't want I don't want to use RIS
35:21
I don't want I don't want to use RIS
35:21
I don't want I don't want to use RIS right even though I'm creating this
35:23
right even though I'm creating this
35:23
right even though I'm creating this other component
35:25
other component
35:25
other component right uh that is poting to this other
35:28
right uh that is poting to this other
35:28
right uh that is poting to this other radius
35:29
radius
35:29
radius instance let's say that I want to use
35:32
instance let's say that I want to use
35:32
instance let's say that I want to use sqlite right so let's copy this let's go
35:37
sqlite right so let's copy this let's go
35:37
sqlite right so let's copy this let's go back here paste
35:38
back here paste
35:39
back here paste it and the only required thing is the
35:45
it and the only required thing is the
35:45
it and the only required thing is the connection string can you see this type
35:49
connection string can you see this type
35:49
connection string can you see this type can you see that this is different right
35:52
can you see that this is different right
35:52
can you see that this is different right this other one was a state redish and
35:54
this other one was a state redish and
35:54
this other one was a state redish and this one is state sqlite since you are
35:58
this one is state sqlite since you are
35:58
this one is state sqlite since you are using this this different technology
36:01
using this this different technology
36:01
using this this different technology right and this is fantastic friends
36:04
right and this is fantastic friends
36:04
right and this is fantastic friends since you are configuring your
36:07
since you are configuring your
36:07
since you are configuring your application for using different targets
36:11
application for using different targets
36:11
application for using different targets right different
36:13
right different
36:13
right different Technologies in this particular case
36:16
Technologies in this particular case
36:16
Technologies in this particular case this is just for the State Management
36:18
this is just for the State Management
36:18
this is just for the State Management building blog but this is how building
36:22
building blog but this is how building
36:22
building blog but this is how building blocks work and Dapper works you just
36:26
blocks work and Dapper works you just
36:26
blocks work and Dapper works you just configure things outside your
36:29
configure things outside your
36:29
configure things outside your application I don't need to use sqlite
36:32
application I don't need to use sqlite
36:32
application I don't need to use sqlite you know um s Cas or I don't know the
36:36
you know um s Cas or I don't know the
36:36
you know um s Cas or I don't know the microsoft. data SQL client classes and
36:40
microsoft. data SQL client classes and
36:40
microsoft. data SQL client classes and those kind of things not
36:44
those kind of things not
36:44
those kind of things not necessary you're just using the building
36:47
necessary you're just using the building
36:47
necessary you're just using the building block and configure the building block
36:50
block and configure the building block
36:50
block and configure the building block outside your
36:52
outside your
36:52
outside your application so let's say this is a state
36:55
application so let's say this is a state
36:55
application so let's say this is a state store right and the con C string this is
36:58
store right and the con C string this is
36:58
store right and the con C string this is the only thing that is
37:00
the only thing that is
37:00
the only thing that is required I'm going to use data. DB but
37:03
required I'm going to use data. DB but
37:03
required I'm going to use data. DB but of course it can be I don't know doering
37:05
of course it can be I don't know doering
37:05
of course it can be I don't know doering action. DB what have you right so the
37:09
action. DB what have you right so the
37:09
action. DB what have you right so the thing is that I'm creating this other
37:11
thing is that I'm creating this other
37:11
thing is that I'm creating this other component here okay and
37:15
component here okay and
37:15
component here okay and now let's navigate again to my state
37:19
now let's navigate again to my state
37:19
now let's navigate again to my state service and I want to show you another
37:25
flag let me show you this flag
37:28
flag let me show you this flag
37:28
flag let me show you this flag which is
37:30
which is
37:30
which is um
37:33
Dron
37:36
um I believe it's resources
37:41
um I believe it's resources
37:41
um I believe it's resources path resources
37:44
path resources
37:44
path resources path this is just for passing and you
37:47
path this is just for passing and you
37:47
path this is just for passing and you know what the other components or please
37:50
know what the other components or please
37:51
know what the other components or please use this particular path for your
37:56
configurations and I'm hesitating here
37:58
configurations and I'm hesitating here
37:58
configurations and I'm hesitating here since uh this flag there was another
38:01
since uh this flag there was another
38:01
since uh this flag there was another flag that was deprecated I think it
38:05
flag that was deprecated I think it
38:05
flag that was deprecated I think it was custom components path or components
38:11
was custom components path or components
38:11
was custom components path or components path anyway let's try to use
38:15
path anyway let's try to use
38:15
path anyway let's try to use this
38:17
this
38:17
this resource um let me go and clear the
38:20
resource um let me go and clear the
38:20
resource um let me go and clear the screen
38:22
screen
38:22
screen and resources
38:25
and resources
38:25
and resources path oh my God I just forgot I'm sorry
38:30
path oh my God I just forgot I'm sorry
38:30
path oh my God I just forgot I'm sorry doer on help researches path
38:35
doer on help researches path
38:35
doer on help researches path yes I think that is
38:37
yes I think that is
38:37
yes I think that is it okay let's try this researches path
38:43
it okay let's try this researches path
38:43
it okay let's try this researches path and it's going to
38:44
and it's going to
38:44
and it's going to be uh this folder
38:48
be uh this folder
38:49
be uh this folder right
38:50
right
38:50
right so let's see if this
38:53
so let's see if this
38:53
so let's see if this works oh no no no no it didn't work
38:57
works oh no no no no it didn't work
38:57
works oh no no no no it didn't work uh so something is wrong with
39:01
uh so something is wrong with
39:01
uh so something is wrong with this what it components path I think
39:05
this what it components path I think
39:05
this what it components path I think it's components
39:07
it's components
39:07
it's components path
39:09
path
39:09
path components
39:11
components
39:11
components path no no no components
39:15
path no no no components
39:15
path no no no components path so I need to check my notes to
39:20
path so I need to check my notes to
39:20
path so I need to check my notes to specify please hold
39:23
specify please hold
39:23
specify please hold on bear with me okay let me see my notes
39:27
on bear with me okay let me see my notes
39:27
on bear with me okay let me see my notes since that flag is
39:31
since that flag is
39:31
since that flag is different um
39:34
different um
39:34
different um so
39:39
components yeah components path that is
39:43
components yeah components path that is
39:43
components yeah components path that is it components path and then you pass the
39:46
it components path and then you pass the
39:46
it components path and then you pass the folder and I think that is
39:48
folder and I think that is
39:48
folder and I think that is it but something is wrong here uh
39:52
it but something is wrong here uh
39:52
it but something is wrong here uh shutting
39:54
shutting
39:54
shutting down um
39:59
[Music]
40:03
both
40:05
both
40:05
both stopper oh my God I have the hell plaque
40:11
here did you see
40:14
here did you see
40:14
here did you see that everything is so confusing when you
40:17
that everything is so confusing when you
40:17
that everything is so confusing when you have a lot of you know a large command
40:21
have a lot of you know a large command
40:21
have a lot of you know a large command in the terminal of course it was it's
40:24
in the terminal of course it was it's
40:24
in the terminal of course it was it's not behaving what wasn't behaving
40:26
not behaving what wasn't behaving
40:26
not behaving what wasn't behaving correctly since I was just passing the
40:29
correctly since I was just passing the
40:29
correctly since I was just passing the help command as part of the
40:32
help command as part of the
40:32
help command as part of the application
40:34
application
40:34
application execution which of course is just going
40:37
execution which of course is just going
40:37
execution which of course is just going to return the help right anyway let's
40:41
to return the help right anyway let's
40:41
to return the help right anyway let's use components path and this is going to
40:43
use components path and this is going to
40:43
use components path and this is going to work
40:45
work
40:45
work correctly right and I think resources
40:47
correctly right and I think resources
40:47
correctly right and I think resources path as well anyway let's try first with
40:51
path as well anyway let's try first with
40:51
path as well anyway let's try first with component components path which is
40:54
component components path which is
40:54
component components path which is deprecated you can see this components
40:57
deprecated you can see this components
40:57
deprecated you can see this components components path has been deprecated this
41:00
components path has been deprecated this
41:00
components path has been deprecated this flag is deprecated and will be removed
41:02
flag is deprecated and will be removed
41:02
flag is deprecated and will be removed in the future releases in the future
41:04
in the future releases in the future
41:04
in the future releases in the future releases use researches PAAD okay I was
41:07
releases use researches PAAD okay I was
41:07
releases use researches PAAD okay I was I was correct I was right anyway the
41:11
I was correct I was right anyway the
41:11
I was correct I was right anyway the thing here friends is that I can go back
41:15
thing here friends is that I can go back
41:15
thing here friends is that I can go back here and send the
41:18
here and send the
41:18
here and send the request and let's see what happened doer
41:23
request and let's see what happened doer
41:23
request and let's see what happened doer inaction State and then my state service
41:27
inaction State and then my state service
41:27
inaction State and then my state service and you can see that I have data. DB
41:33
and you can see that I have data. DB
41:33
and you can see that I have data. DB right I didn't do anything else
41:37
right I didn't do anything else
41:37
right I didn't do anything else Dapper in this case the dopper concrete
41:40
Dapper in this case the dopper concrete
41:40
Dapper in this case the dopper concrete implementation of the State Management
41:42
implementation of the State Management
41:42
implementation of the State Management building
41:43
building
41:43
building block uh of you know the sqlite one
41:47
block uh of you know the sqlite one
41:47
block uh of you know the sqlite one created
41:48
created
41:48
created this and if I used I don't know
41:51
this and if I used I don't know
41:52
this and if I used I don't know something with Asher then it would
41:55
something with Asher then it would
41:55
something with Asher then it would create the thing in Asher and it it
41:58
create the thing in Asher and it it
41:58
create the thing in Asher and it it would use Asher at as a state store
42:02
would use Asher at as a state store
42:02
would use Asher at as a state store meaning you know a blob storage or Asher
42:05
meaning you know a blob storage or Asher
42:05
meaning you know a blob storage or Asher tables or aure Cosmos DB or some other
42:08
tables or aure Cosmos DB or some other
42:08
tables or aure Cosmos DB or some other Technologies as I mentioned
42:11
Technologies as I mentioned
42:11
Technologies as I mentioned before so let me go back to the to here
42:16
before so let me go back to the to here
42:16
before so let me go back to the to here to this documentation right so in this
42:19
to this documentation right so in this
42:19
to this documentation right so in this case I'm using
42:21
case I'm using
42:21
case I'm using um
42:23
um
42:23
um SQL
42:25
SQL
42:25
SQL right and again you have to pick your
42:29
right and again you have to pick your
42:29
right and again you have to pick your technology and that is
42:32
technology and that is
42:32
technology and that is it so let's try to use get and this
42:36
it so let's try to use get and this
42:36
it so let's try to use get and this going to return world so far so good let
42:40
going to return world so far so good let
42:40
going to return world so far so good let me
42:42
open
42:44
open
42:44
open um please uh wait for
42:48
um please uh wait for
42:48
um please uh wait for me so I'm using DB browser for
42:54
me so I'm using DB browser for
42:54
me so I'm using DB browser for sqlite
42:55
sqlite
42:55
sqlite okay and and let's navigate here and
43:00
okay and and let's navigate here and
43:00
okay and and let's navigate here and open this
43:02
open this
43:02
open this database right and I have this state
43:07
database right and I have this state
43:07
database right and I have this state table that was created by the dopper
43:11
table that was created by the dopper
43:11
table that was created by the dopper component and you can see that I have
43:13
component and you can see that I have
43:13
component and you can see that I have hello and the value which is in this
43:17
hello and the value which is in this
43:17
hello and the value which is in this case it looks like it's um
43:21
case it looks like it's um
43:21
case it looks like it's um um I don't know if this is base 64 or if
43:25
um I don't know if this is base 64 or if
43:25
um I don't know if this is base 64 or if it was encrypted it it all depends on
43:27
it was encrypted it it all depends on
43:27
it was encrypted it it all depends on the concrete implementation of the state
43:29
the concrete implementation of the state
43:29
the concrete implementation of the state store okay anyway you can see that I'm
43:34
store okay anyway you can see that I'm
43:34
store okay anyway you can see that I'm successfully retrieving the state by
43:37
successfully retrieving the state by
43:37
successfully retrieving the state by using this um other
43:40
using this um other
43:40
using this um other endpoint fantastic fantastic okay
43:45
endpoint fantastic fantastic okay
43:45
endpoint fantastic fantastic okay uh Friday Emmanuel please can you teach
43:49
uh Friday Emmanuel please can you teach
43:49
uh Friday Emmanuel please can you teach me CP there are many many many different
43:53
me CP there are many many many different
43:53
me CP there are many many many different C uh learning resources out there
43:57
C uh learning resources out there
43:57
C uh learning resources out there I don't think I'm gonna maybe next year
44:00
I don't think I'm gonna maybe next year
44:00
I don't think I'm gonna maybe next year who knows my good friend Stephen Simon
44:03
who knows my good friend Stephen Simon
44:03
who knows my good friend Stephen Simon is here maybe I will propose a
44:07
is here maybe I will propose a
44:07
is here maybe I will propose a CP uh in action series for next year who
44:13
CP uh in action series for next year who
44:13
CP uh in action series for next year who knows cool so this is great this is
44:17
knows cool so this is great this is
44:17
knows cool so this is great this is great this is fantastic friends right
44:21
great this is fantastic friends right
44:21
great this is fantastic friends right you're using the sidecar you plug in the
44:24
you're using the sidecar you plug in the
44:24
you're using the sidecar you plug in the saate store I showed you read is and I
44:28
saate store I showed you read is and I
44:28
saate store I showed you read is and I showed you SQL ey just by changing a jam
44:31
showed you SQL ey just by changing a jam
44:31
showed you SQL ey just by changing a jam file this is NS this is
44:35
file this is NS this is
44:35
file this is NS this is marvelous okay so let me talk you talk
44:40
marvelous okay so let me talk you talk
44:40
marvelous okay so let me talk you talk about this transactional out books
44:43
about this transactional out books
44:43
about this transactional out books pattern
44:45
pattern
44:45
pattern um that the State Management building
44:48
um that the State Management building
44:48
um that the State Management building block allows you to
44:51
block allows you to
44:51
block allows you to implement so the thing about the
44:54
implement so the thing about the
44:54
implement so the thing about the transactional outbox pattern is
44:57
transactional outbox pattern is
44:58
transactional outbox pattern is that it allows you to ensure the data is
45:04
that it allows you to ensure the data is
45:04
that it allows you to ensure the data is consistent and reliable when
45:08
consistent and reliable when
45:08
consistent and reliable when you change the state
45:11
you change the state
45:11
you change the state somehow you are using the state store
45:15
somehow you are using the state store
45:15
somehow you are using the state store saving the state and then you w to you
45:19
saving the state and then you w to you
45:19
saving the state and then you w to you know you want to notify some other
45:21
know you want to notify some other
45:21
know you want to notify some other services or components in your
45:24
services or components in your
45:24
services or components in your distributed
45:25
distributed
45:25
distributed application that something happened with
45:28
application that something happened with
45:28
application that something happened with that particular local
45:30
that particular local
45:30
that particular local data so let me rephrase that let's think
45:35
data so let me rephrase that let's think
45:35
data so let me rephrase that let's think that we're creating a microservices
45:38
that we're creating a microservices
45:38
that we're creating a microservices application right so sometimes you have
45:41
application right so sometimes you have
45:41
application right so sometimes you have microservice a microservice b
45:44
microservice a microservice b
45:44
microservice a microservice b microservice
45:45
microservice
45:46
microservice c and of course this is a discussion
45:48
c and of course this is a discussion
45:48
c and of course this is a discussion about how to you know create those
45:51
about how to you know create those
45:51
about how to you know create those bounded contexts and how to what what
45:55
bounded contexts and how to what what
45:55
bounded contexts and how to what what would be this particular behavior of a
45:59
would be this particular behavior of a
45:59
would be this particular behavior of a microservice right and what would be the
46:02
microservice right and what would be the
46:02
microservice right and what would be the uh
46:03
uh
46:03
uh frontiers of those microservices that
46:06
frontiers of those microservices that
46:06
frontiers of those microservices that that's tough okay maybe you want to use
46:09
that's tough okay maybe you want to use
46:09
that's tough okay maybe you want to use something like domain driven design for
46:12
something like domain driven design for
46:12
something like domain driven design for identifying those
46:15
identifying those
46:15
identifying those Scopes anyway sometimes you need to
46:18
Scopes anyway sometimes you need to
46:18
Scopes anyway sometimes you need to notify
46:20
notify
46:20
notify asynchronously to the other
46:22
asynchronously to the other
46:22
asynchronously to the other microservices say you know what this
46:25
microservices say you know what this
46:25
microservices say you know what this data has changed
46:27
data has changed
46:27
data has changed right you you want to
46:29
right you you want to
46:29
right you you want to notify the other components how in the
46:34
notify the other components how in the
46:34
notify the other components how in the world can you do
46:36
world can you do
46:37
world can you do that uh
46:40
that uh
46:40
that uh reliable you know in a reliable
46:45
reliable you know in a reliable
46:45
reliable you know in a reliable way so the thing is that if you don't
46:48
way so the thing is that if you don't
46:48
way so the thing is that if you don't use something like the transactional all
46:51
use something like the transactional all
46:51
use something like the transactional all books
47:07
it was disconnected or something
47:10
it was disconnected or something
47:10
it was disconnected or something happened and somehow micros service B
47:13
happened and somehow micros service B
47:13
happened and somehow micros service B and microservice C are not aware of the
47:17
and microservice C are not aware of the
47:17
and microservice C are not aware of the change that happened in microservice
47:20
change that happened in microservice
47:20
change that happened in microservice a right or the other way around as well
47:25
a right or the other way around as well
47:25
a right or the other way around as well let's say that you want to store the
47:29
let's say that you want to store the
47:29
let's say that you want to store the state you want to save something right
47:31
state you want to save something right
47:31
state you want to save something right you want to change the
47:34
state and that
47:38
state and that
47:38
state and that fails but regardless of that failure you
47:42
fails but regardless of that failure you
47:42
fails but regardless of that failure you send the
47:44
send the
47:44
send the notification right so you're sending
47:47
notification right so you're sending
47:47
notification right so you're sending this
47:48
this
47:48
this inconsistent message to those
47:51
inconsistent message to those
47:51
inconsistent message to those other uh
47:54
other uh
47:54
other uh components and that's why we we need
47:57
components and that's why we we need
47:57
components and that's why we we need something like the transactional
47:59
something like the transactional
47:59
something like the transactional outbox and Dapper allows you to
48:03
outbox and Dapper allows you to
48:03
outbox and Dapper allows you to implement this pattern easily let me
48:06
implement this pattern easily let me
48:06
implement this pattern easily let me show you this with uh this diagram okay
48:12
show you this with uh this diagram okay
48:12
show you this with uh this diagram okay so service a has its own side card right
48:16
so service a has its own side card right
48:16
so service a has its own side card right we have the state s you want to save the
48:18
we have the state s you want to save the
48:19
we have the state s you want to save the state and you have the message broker
48:22
state and you have the message broker
48:22
state and you have the message broker right so you want this to things to
48:27
right so you want this to things to
48:27
right so you want this to things to happen
48:29
happen
48:29
happen transactionally I don't know if
48:30
transactionally I don't know if
48:30
transactionally I don't know if transactionally is a is an English word
48:33
transactionally is a is an English word
48:33
transactionally is a is an English word but you get it right those two actions
48:37
but you get it right those two actions
48:37
but you get it right those two actions need to happen inside a
48:40
need to happen inside a
48:40
need to happen inside a transaction to be
48:43
transaction to be
48:43
transaction to be reliable right you want to save the
48:45
reliable right you want to save the
48:45
reliable right you want to save the state and publish the me the message to
48:48
state and publish the me the message to
48:48
state and publish the me the message to the message broker
48:51
the message broker
48:51
the message broker transactionally right and then of course
48:55
transactionally right and then of course
48:55
transactionally right and then of course the message broker
48:57
the message broker
48:57
the message broker whatever that is it's going to send the
49:00
whatever that is it's going to send the
49:00
whatever that is it's going to send the message to the
49:01
message to the
49:01
message to the subscribers and those subscribers are
49:04
subscribers and those subscribers are
49:04
subscribers and those subscribers are going to receive the message and they
49:06
going to receive the message and they
49:06
going to receive the message and they can do whatever they are intended
49:10
can do whatever they are intended
49:10
can do whatever they are intended to to to do
49:13
to to to do
49:13
to to to do right so this is a transactional outbox
49:16
right so this is a transactional outbox
49:16
right so this is a transactional outbox and with the state management building
49:19
and with the state management building
49:19
and with the state management building block you can
49:22
block you can
49:22
block you can enable the transactional outbox
49:26
enable the transactional outbox
49:26
enable the transactional outbox um
49:28
um
49:28
um Behavior just by using the following
49:33
Behavior just by using the following
49:33
Behavior just by using the following configurations so be aware that this
49:35
configurations so be aware that this
49:35
configurations so be aware that this depends on your you know state store
49:39
depends on your you know state store
49:39
depends on your you know state store technology that you want to
49:41
technology that you want to
49:41
technology that you want to use for
49:43
use for
49:43
use for instance you need to use a technology
49:47
instance you need to use a technology
49:47
instance you need to use a technology that
49:48
that
49:48
that supports transactional actions
49:51
supports transactional actions
49:51
supports transactional actions right for instance you can't use
49:55
right for instance you can't use
49:55
right for instance you can't use Cassandra
49:57
Cassandra
49:57
Cassandra in you know in Dapper because it's not
50:01
in you know in Dapper because it's not
50:01
in you know in Dapper because it's not it doesn't support transactions right uh
50:05
it doesn't support transactions right uh
50:05
it doesn't support transactions right uh similar to I don't know Hashi Corp
50:08
similar to I don't know Hashi Corp
50:08
similar to I don't know Hashi Corp console or M catched or reink DB and so
50:13
console or M catched or reink DB and so
50:13
console or M catched or reink DB and so on you want to use
50:14
on you want to use
50:14
on you want to use those um technologies that support
50:18
those um technologies that support
50:18
those um technologies that support transactional right here
50:21
transactional right here
50:21
transactional right here right okay cool so you need to specify
50:24
right okay cool so you need to specify
50:24
right okay cool so you need to specify the outbox p pops up configuration this
50:29
the outbox p pops up configuration this
50:29
the outbox p pops up configuration this attribute inside the metadata of your
50:32
attribute inside the metadata of your
50:32
attribute inside the metadata of your spec and this is the name of the pops up
50:36
spec and this is the name of the pops up
50:36
spec and this is the name of the pops up component that is going to deliver the
50:40
component that is going to deliver the
50:40
component that is going to deliver the you know the not notifications and this
50:42
you know the not notifications and this
50:42
you know the not notifications and this is
50:44
is
50:44
is required for instance pops up right or
50:48
required for instance pops up right or
50:48
required for instance pops up right or my pops up or the name of the component
50:51
my pops up or the name of the component
50:51
my pops up or the name of the component that you want to use in this case uh I
50:56
that you want to use in this case uh I
50:56
that you want to use in this case uh I don't know no let's go back here and
50:59
don't know no let's go back here and
50:59
don't know no let's go back here and Dapper and then components and I have uh
51:03
Dapper and then components and I have uh
51:03
Dapper and then components and I have uh pops up so the name is popop and I'm
51:07
pops up so the name is popop and I'm
51:07
pops up so the name is popop and I'm just showing you the default values here
51:10
just showing you the default values here
51:10
just showing you the default values here right so pops up in this uh
51:14
right so pops up in this uh
51:14
right so pops up in this uh fictitious
51:16
fictitious
51:16
fictitious component uh is my pops up but it's it
51:20
component uh is my pops up but it's it
51:20
component uh is my pops up but it's it doesn't matter it has to be the name of
51:22
doesn't matter it has to be the name of
51:22
doesn't matter it has to be the name of the pops up component that you want to
51:23
the pops up component that you want to
51:23
the pops up component that you want to use for delivering those notific s and
51:27
use for delivering those notific s and
51:27
use for delivering those notific s and then outbox published topic which is the
51:31
then outbox published topic which is the
51:31
then outbox published topic which is the topic name that is going to receive the
51:34
topic name that is going to receive the
51:34
topic name that is going to receive the state
51:35
state
51:35
state changes okay this is required as
51:38
changes okay this is required as
51:38
changes okay this is required as well so in this case new order or I
51:43
well so in this case new order or I
51:43
well so in this case new order or I don't know new new I don't know new
51:47
don't know new new I don't know new
51:47
don't know new new I don't know new client new customer new product or I
51:51
client new customer new product or I
51:51
client new customer new product or I don't know the name of the topic that
51:52
don't know the name of the topic that
51:52
don't know the name of the topic that you want to use right and then this one
51:55
you want to use right and then this one
51:55
you want to use right and then this one is
51:57
is
51:57
is optional and this is when you have two
52:00
optional and this is when you have two
52:01
optional and this is when you have two different message
52:02
different message
52:02
different message Brokers one for notifying the other
52:06
Brokers one for notifying the other
52:06
Brokers one for notifying the other components and the component that is
52:09
components and the component that is
52:09
components and the component that is going to coordinate the transactions
52:11
going to coordinate the transactions
52:11
going to coordinate the transactions between the state and the message
52:14
between the state and the message
52:14
between the state and the message broker I think this is a this is great
52:18
broker I think this is a this is great
52:18
broker I think this is a this is great this is this is a great option but
52:21
this is this is a great option but
52:21
this is this is a great option but sometimes it's the same pops up
52:23
sometimes it's the same pops up
52:23
sometimes it's the same pops up component that is going to manage the
52:26
component that is going to manage the
52:26
component that is going to manage the transaction and the one that is going to
52:29
transaction and the one that is going to
52:29
transaction and the one that is going to deliver the message but if you want to
52:32
deliver the message but if you want to
52:32
deliver the message but if you want to have a different pops up component this
52:35
have a different pops up component this
52:35
have a different pops up component this is the configuration that you
52:37
is the configuration that you
52:37
is the configuration that you need and this other one is um it tells
52:43
need and this other one is um it tells
52:43
need and this other one is um it tells Dapper um if you want to discard the
52:47
Dapper um if you want to discard the
52:47
Dapper um if you want to discard the transaction if uh or when the state
52:50
transaction if uh or when the state
52:51
transaction if uh or when the state cannot be found okay so optional as well
52:56
cannot be found okay so optional as well
52:56
cannot be found okay so optional as well so you
52:56
so you
52:57
so you those two outbox published pops up and
52:59
those two outbox published pops up and
52:59
those two outbox published pops up and outbox published topic and that's it in
53:03
outbox published topic and that's it in
53:03
outbox published topic and that's it in this way you can configure your State
53:05
this way you can configure your State
53:06
this way you can configure your State Management component for uh supporting
53:10
Management component for uh supporting
53:10
Management component for uh supporting transactions and the transaction outbox
53:14
transactions and the transaction outbox
53:14
transactions and the transaction outbox and of course you need to use um uh the
53:18
and of course you need to use um uh the
53:18
and of course you need to use um uh the doer client object most of the time of
53:20
doer client object most of the time of
53:21
doer client object most of the time of course as I mentioned
53:22
course as I mentioned
53:22
course as I mentioned before and in this way you can have this
53:28
before and in this way you can have this
53:28
before and in this way you can have this behavior in your applications let me go
53:32
behavior in your applications let me go
53:32
behavior in your applications let me go back
53:33
back
53:33
back here and let me
53:36
here and let me
53:36
here and let me see if I can find the transactional
53:41
see if I can find the transactional
53:41
see if I can find the transactional outbox conf uh not configuration but the
53:46
outbox conf uh not configuration but the
53:46
outbox conf uh not configuration but the documentation
53:49
documentation
53:49
documentation um that is right in this other monitor
53:53
um that is right in this other monitor
53:53
um that is right in this other monitor right here so I'm just showing you the
53:56
right here so I'm just showing you the
53:56
right here so I'm just showing you the is because if you want to learn more
53:58
is because if you want to learn more
53:58
is because if you want to learn more about the transactional outbox pattern
54:02
about the transactional outbox pattern
54:02
about the transactional outbox pattern and how to use it in Dapper here's the
54:06
and how to use it in Dapper here's the
54:06
and how to use it in Dapper here's the documentation okay so as you can see
54:09
documentation okay so as you can see
54:09
documentation okay so as you can see here this is just using execute State
54:13
here this is just using execute State
54:13
here this is just using execute State transaction
54:15
transaction
54:15
transaction aing in it's sending uh the
54:18
aing in it's sending uh the
54:18
aing in it's sending uh the values um that are going to be delivered
54:22
values um that are going to be delivered
54:22
values um that are going to be delivered to the other microservice right
54:27
to the other microservice right
54:27
to the other microservice right right
54:28
right
54:28
right here okay cool
54:31
here okay cool
54:31
here okay cool so I think that is it for
54:35
so I think that is it for
54:35
so I think that is it for today
54:38
today
54:38
today um and of course you want to if you want
54:40
um and of course you want to if you want
54:41
um and of course you want to if you want to use the API directly you can always
54:44
to use the API directly you can always
54:44
to use the API directly you can always do that I don't think that's real world
54:48
do that I don't think that's real world
54:48
do that I don't think that's real world to be honest this is perfect for demo
54:51
to be honest this is perfect for demo
54:51
to be honest this is perfect for demo purposes um but again generally speaking
54:56
purposes um but again generally speaking
54:56
purposes um but again generally speaking you want to use the official SDK for
54:58
you want to use the official SDK for
54:58
you want to use the official SDK for your programming language that you're
55:00
your programming language that you're
55:00
your programming language that you're using anyway if you want to use the API
55:04
using anyway if you want to use the API
55:04
using anyway if you want to use the API directly this is the end point uh for
55:08
directly this is the end point uh for
55:08
directly this is the end point uh for the State Management building
55:10
the State Management building
55:10
the State Management building block so that was it for today friends
55:14
block so that was it for today friends
55:14
block so that was it for today friends beautiful people from around the
55:17
beautiful people from around the
55:17
beautiful people from around the world
55:19
world
55:19
world um and this is the last session of the
55:23
um and this is the last session of the
55:23
um and this is the last session of the Year and happy New Year happy new
55:28
Year and happy New Year happy new
55:28
Year and happy New Year happy new 2025 see you next week and be happy
55:32
2025 see you next week and be happy
55:32
2025 see you next week and be happy friends and happy coding
55:36
friends and happy coding
55:36
friends and happy coding [Music]