All language subtitles for 035-Receiving Events-git.ir

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Let's go ahead and put our events handlers together for the Postal Service and the common service.

So I'm going to get started by going first to my post service.

I'll find the index such as file and then turn the very bottom the file but right above the apt listen

line I'll add in a new post request handler.

So this will be asked post to slash events.

We'll get our rack and rest in their

and then remember this end point is going to receive any event that is coming over from our event bus.

So right now inside of our postal service we don't really care about any events that are coming over.

But let's just go ahead and log any events that we receive just to say hey this event exists I'll do

a console dot log of received event

and we'll just print out the type of the event.

How about wreck dot body that's gonna be the actual event.

And remember every event that we receive we said that it was going to have a type property dial up print

out the type of event that we just got after that.

I'll make sure that I still respond to the request that was issued just to say hey we got this.

We'll do a red dot send of empty object just to say yeah we got this event.

Everything's good to go so now repeat the same process over inside of our common service as well.

They'll find my comments directory index dot J.S. inside of there we'll go down towards the bottom and

right above the apt Atlas in line.

I'll do an app dot post for events

we'll do a console log of event received and wreck dot body type

and we'll do our resource sent empty object OK.

So that should be enough to test this stuff out.

Now we're going to really see the entire process here.

We're going to see everything from start to finish if we take a look at our terminal after we start

to we met some events we should see some console log coming from our post service and the comment service

and they should say every single time they receive some kind of event so let's try to test this out.

I'll go backwards the browser and find my application.

I'm going to refresh the page once again.

Remember every single time we make a change to our code we dump all of our data.

I'll go ahead and create a post of say new post and submit if I refresh.

Yep there's the post.

But more importantly let's go over to our terminal.

Here's my terminal window and I can see that we've received an event for post created inside of our

postal service.

This terminal window right here is from my comment.

And we've also received an event of post created or event bus is still during an air down here.

That's OK because remember it's trying to send a request or this event over to our query service which

does not yet exist let's also try to create a comment and just make sure that the event of comment created

is being sent to the post common service as well so back inside my browser.

I'll put in a comment here of a comment submitted I'll refresh.

Just make sure I see the comment right there.

And then finally I go back or maternal.

There we go.

So I've got my event of common created and common created.

OK.

So that is it.

That is the full communication cycle.

We have our postal service sending events over the event bus takes that event and sends it off to service

one and two and then a little bit.

Not quite yet but in a little bit I'll try to send off to the query service as well.

So in theory if we had any kind of data dependency or more strict data dependency between our post service

and common service we could watch those incoming events and deal with them in some way.

As I've said several times down the last couple of videos the post and comment service don't really

care about the events that are being emitted right now.

But now that we've got these events coming out let's start to put this query service together we'll

make sure that the query service listens for a post created or a limit created event starts to take

that data and assemble it into some kind of usable data structure in the exact same way that we've discussed

over all these last couple of diagrams.

Where are they like this one.

Yeah.

Here we go like this one right here.

Remember we're going to take all these events and assemble them into some usable data structure.

So we're going to take more than just a moment.

So see you.

And just a little bit.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.