►
From YouTube: Jakarta Tech Talk - Building cloud native microservices with MicroProfile and Jakarta EE
Description
Show how to build a microservices with Microprofile by adding cloud native features from Microprofile. I believe a hands-on live coding session with incremently adding features will show how easy it is to use Microprofile to build production grade microservices.
A
Hello,
everyone
and
welcome
to
another
Jakarta
Tech
talk.
My
name
is
Serena
and
joining
us
today
is
Ron
Veen,
who
will
be
presenting
on
the
topic
of
building
Cloud
native
microservices
with
micro
profile
and
Jakarta
ee.
If
you
have
any
questions
for
Ron
as
we
move
through,
today's
presentation
feel
free
to
ask
it
in
the
chat
or
use
the
ask
a
questions
tab
without
any
further
delay.
Ron
over
to
you.
B
Thank
you.
Yes
welcome
everyone
and
great
that
you
actually
want
to
join
me
on
this
introduction
to
Jakarta,
EE
and
micro
profile,
I'm,
just
going
to
start
with
a
short
presentation
to
give
you
an
idea
what
we're
going
to
be
talking
about,
and
then
we'll
do
some
Hands-On
coding.
So
that
would
be
the
agenda.
A
sure
thing
about
me:
I'm
doing
something
like
20,
plus
Java
development
on
and
off
I'm
a
developer
and
a
special
agent
at
a
company
called
team
rockstars.
B
It
I
do
like
speak
at
conferences
and
currently
I'm
writing
a
book
on
how
to
migrate,
Jakarta
ee
to
a
newer
version
right.
So
what
is
Jakarta
ee
I
guess?
We
should
first
look
at
the
two
technologies.
Well,
it
focuses
on
developing
large-scale
Enterprise
applications
with
the
Java
language.
Of
course,
it's
a
set
of
apis
really,
together
with
a
reference
implementation
and
a
technical
compatibility
kit
to
prove
that
they
actually
meet
the
demands
of
the
apis.
It
was
originally
started
as
j2ee
and
later
j-e-e
by
Sun
Microsystems.
B
B
There
have
been
three
releases
since
Java
ee
was
the
transition
release
from
Oracle
to
Eclipse
jata
Jakarta
ee9
had
everything
moved
from
the
Java
X
namespace
in
packages
to
Jakarta
and
finally,
just
recently
released
Jakarta
ee10,
with
new
functionality
being
added
to
the
project
and
already
talks
are
being
held
now
for
what
to
include
into
Jakarta
EE
11..
B
Looking
at
the
platform,
it
consists
basically
of
three
profiles:
there's
a
new
core
profile,
which
is
new
in
Jakarta
ee10,
which
is
really
targeted
at
micro,
surface
style
applications,
Edge
Computing
things
like
that,
where
you
just
need
a
really
a
subset
of
the
functionality,
which
is
really
small
and
concise.
B
Then,
moving
on
to
micro
profile,
so
microprofile
basically
is
another
set
of
applications
that
bring
to
Jakarta
ee
or
formerly
Java
IE.
What
wasn't
there
yet,
which
is
the
cloud
nativeness
Java
ee,
had
its
releases,
but
they
were
very
infrequent
and
with
long
intervals,
which
was
basically
a
no-go
in
the
time
when
we
had
all
these
developments
going
on
in
with
web
related
Technologies
and
things
moved
so
fast,
then,
and
then
you
had
to
wait
like
two
three
four
years
before
you
could
get
new
things
into
a
Java
ee
release.
B
So
what
basically
happened
is
that
all
the
vendors
from
the
different
application
service
they
started
to
implementing
their
own
set
of
apis,
but
if
you
think
about
it,
that
goes
against
everything.
What
the
whole
Jee
ID
stands
for.
That
is
really
to
to
have
a
standard
set
of
apis,
and
now
everything
everyone
was
building
their
own
set.
B
So
a
group
of
Hendersons
of
individuals
started
micro
profile
in
2016
and
they
said
well
we're
going
to
make
some
specifications
and
we,
you
know
we're
going
to
use
some
default
Jakarta
ee
specifications
and
on
top
of
that,
we're
gonna
build
our
own
set
of
specifications
so
no
longer
every
vendor
having
their
own
specifications,
but
we're
going
to
make
another
standard
on
top
of
this
one,
and
so
they
came
up
with
specifications
for
resilience,
configuration
metrics,
distributed
tracing
Etc.
We
will
go
through
a
number
of
them
Hands-On.
B
B
It
was
very
interesting
to
see
that
the
first
thing
they
address
with
microprofile
was
having
a
really
short
release.
Cycles
in
the
beginning,
they
were
extremely
short
where
they
just
said:
okay,
we
we
hammering
out
this
API,
we
kind
of
put
it
there
in
the
market.
We're
gonna
see
if
it
gets
adduction.
If
it
gets
adapted
great,
we'll
continue
it.
If
it
doesn't
we'll
see
if
we
need
to
tweak
it
so
that
went
really
really
quick
to
indicate
started,
then
in
2016
and
now
we're
already
at
release.
6.0.
B
So
what
are
the
specifications
and
the
apis
in
micro
profile?
Oh,
as
you
can
see
here,
there's
a
default
set
that
everyone
who
have
wants
to
be
micro
profile
compatible,
has
to
implement
and
there's
a
set
of
Standalone
apis
like
the
long
running
actions
API
or
the
graphql
API,
no
necessarily
needed
to
be
implemented,
but
they're
still
there
and
and
there's
still
this
demand
of
having
some
standards
there
as
well.
B
B
That
was
the
part
where
we
actually
talked
about
all
the
slides
and
now
we're
gonna
switch
to
the
code.
Editor
and
we're
just
gonna
have
first
have
a
look
at
Jakarta,
EE
and
microservices,
specifically
within
Jakarta
ee
I.
Have
this
tiny
program
started
up
here
and
the
most
interesting
part
is
even
though
we
are
getting
in
all
these
specifications,
we
basically
only
need
two
dependencies.
B
B
So
that
is
our
application,
starting
at
the
basics
of
the
application
and
also
in
our
jobs,
arrest,
Works,
Jox
RS
is
the
restful
API,
which
is
part
of
both
Jakarta
IE
and
also
leveraged
in
micro
profile.
You
can
see
that
we're
basically
telling
here.
Okay,
you
are
an
application,
and
this
is
a
class
defined
within
the
Jakarta
framework,
and
we
tell
it
with
the
application
path.
This
is
where
your
endpoint
is
and
where
clients
can
reach
you.
So
this
is
the
application
part.
B
Next
up
would
be
that
you
would
have
a
project
a
resource
with
a
lot
of
annotations
on
there,
so
it
tells
here
with
the
path
annotation,
okay,
after
the
slash
API,
if
you
use
the
slash
projects,
this
is
where
you
can
reach
me.
Then
it
tells
that
every
input
it
takes
like
from
the
body
content
of
calls,
it
should
be
application,
Json
and
everything
it
produces
itself-
will
also
be
Json
format.
B
Those
are
the
jobs
are
X
implementations.
Then,
if
we
move
on
to,
for
instance,
this
method,
this
is
something
where
it
tells
us.
Okay,
I
want
to
retrieve
via
HTTP,
get
response,
some
data
from
this
path,
and
this
path
basically
gets
appended
to
the
part
we
saw
above
and
having
it
defined
like
this.
It
is
just
a
parameter.
B
So
what
is
really
says
here,
if
you
would
send
something
to
API
projects,
slash
projects,
slash
one,
it
would
try
to
retrieve
the
resource
named
projects
with
the
identifier
one
which
we're
going
to
see
in
a
second
one.
More
thing
I
want
to
show
you
first
is
there's
no
database
behind
this
application,
so
this
application
here
allows
us
to
create
new
projects,
retrieve
projects
by
idea
or
retrieve
them
all.
There's
just
no
database.
B
B
Right
so
starting
with
the
rest
of
this
microservice,
because
we
first
said:
okay
there's
a
few
endpoints
in
there,
but
we
need
to
add
one.
We
don't
have
a
get
all
end
point
yet
where
we
can
retrieve
all
projects.
Now,
let's
see
how
simple
it
is
to
implement
something
like
that,
we
would
have
a
public
method
where
we
would
call
it
get
all.
There's
no
parameters
as
we
want
to
retrieve
everything
and
basically
repay
and
just
say
what
we're
going
to
return.
B
B
B
B
So
that
should
give
us
at
least
the
possibility
to
run
the
option
here,
and
you
see
we
get
a
response
code
200
now,
there's
just
no
data
in
there
yet.
So
that's
why
the
application
doesn't
return
anything.
Yet
if
I
would
enter
some
data
and
I
would
run
our
endpoint
again,
then
you
can
actually
see
that
we're
getting
the
data
returned
here
in
a
list,
and
that
is
how
simple
Jakarta
ee
makes
restful
web
services
going
back
to
one
point
that
we
talked
about
before
I
said:
okay,
we're
calling
this
service
method
here.
B
B
Basically
I
have
a
project
surface
here
which
I
gave
a
scope.
In
this
case
it
was
an
application
scope,
there's
different
Scopes
available.
There's,
request
scope,
this
session
scope,
there's
conversations
code
and,
depending
on
the
profile
you're
choosing
there
can
be
different.
Scopes
application
scope
basically
says
kind
of
a
Singleton
I
have
one
object
which
will
be
used
for
every
part
of
the
application.
B
Because
it
is
application
scoped,
it
gets
registered
by
CDI.
So
as
soon
as
I
say
in
my
resource
class
that
I
want
to
inject
project,
surface
CDI
will
look
if
something
there
has
been
registered
with
that
name,
and
is
it
if
it
is,
then
it
will
get
automatically
injected
into
the
variable
we're
talking
about
here
service,
so
that
is
part
of
the
dependency
injection
part
of
CDI.
Then
there's
also
the
context
part,
and
this
annotation
here
is
all
about
that.
B
B
Having
gone
through
all
of
this
then
I
think
we
have
covered
the
main
parts
from
Jakarta
AE
used
in
this
simple
application.
B
Perhaps
there's
one
more
feature
that
we
should
just
highlight
a
bit:
I
was
I,
am
returning
a
list
of
java
project
objects.
Here,
still
my
output
gets
to
be
in
Json.
B
All
that
comes
because
I'm
saying
here
up
here:
it
produces
media
type,
application
Json,
so
the
the
jobs
Eric's
runtime
actually
knows.
Oh
wait.
I
got
this
object,
but
I
need
to
translate
it
to
Json.
So
it
does
all
these
things
automatically.
You
don't
have
to
work
with
Jackson
or
Jesus.
It's
all
been
done
for
us.
So
that's
that's
pretty
pretty
neat.
B
Okay!
Moving
on
these
are
the
things
we
really
want
to
talk
about
with
in
relationship
to
Jakarta
ee
itself.
You've
got
this
great
microservices,
it's
doing
really
great,
but
then
you
find
out
when
you
deploy
it
on
the
big
bad
internet,
the
things
actually
might
break
and
things
probably
will
break
you
have
this
monolithic
application
and
suddenly
you
have
all
these
smaller
microservices
moving
Parts,
much
more
Network
interaction
between
them.
Something
definitely
at
some
point.
Will
go
wrong
so
we
need
to
add
a
bit
more
Cloud
nativeness
to
it.
B
So,
let's
see
how
we
can
do
something
like
that.
The
first
thing
out
of
the
box
with
me
without
me
doing
anything
is
that
you
get
an
open,
API
specification
by
default.
If
I
would
go
to
the
server
here
and
refresh
this
part
here,
you
can
actually
see
that
out
of
the
box
I'm
getting
a
lot
of
open
API
specifications
so
for
each
of
my
endpoints
it
is
it
notes
down.
Okay,
was
it
a
post?
Was
it
again
was
it
the
put?
Was
it
the
delete?
B
What
are
the
parameters,
what
what
what
what
needs
to
be
in
there?
So
that
is
actually
quite
good.
B
B
For
instance,
if
you
say
I
want
to
rename
this
parameter
and
it
says
retrieve
a
project
gave
it
a
good
description.
You
just
edit
here
with
these
standard
annotations
and
if
we
would
refresh
it
here,
it
would
here
show
that
information.
So
it's
very
easy
to
add
your
own
flavor
to
your
apis
and
make
it
very
easy
for
your
clients
to
use
your
API.
B
Next
thing
on,
because
one
of
the
next
steps
in
making
an
application
like
Cloud
native,
would
be
configuration
according
to
the
12
Factor
app
configuration
sources
should
always
be
outside
of
the
application,
so
that
it's
easily
to
change.
B
Think
containers
where
you
probably
would
use
environment
variables
to
configure
data
source,
URLs
user,
IDs,
passwords
and
stuff
like
that
they
get
injected.
In
the
last
moment.
B
For
this
there
is
the
config
every
API
and
micro
profile,
where
you
basically
can
define
a
project,
a
a
configuration
value,
and
it
will
look
in
certain
hierarchical
places
for
the
right
configuration
value.
The
most
default
value
where
it
will
look,
will
be
inside
the
micro
profile,
minus
configure
properties
in
the
meter
in
folder.
B
Next,
it
will
look
at
property
files.
It
will
look
at
overrides
on
the
jvm,
with
the
minus
d
parameter
and
finally,
it
will
look
at
environment
variables
and
environment
variables
will
always
overwrite
the
ones
underneath
and
the
ones
underneath.
So
so,
there's
like
this
hierarchy,
and
that
makes
it
very
flexible
to
work
with
these
kinds
of
things.
Now,
how
do
we
access
these
configuration
failures
if
we
really
want
to
access
them
and
and
have
them
inject
it
into
a
program?
Well,
that's
exactly
again
how
it
works.
We
inject
them
in
our
program.
B
Take
a
look
at
the
output
here.
You
can
see
that
a
project
contains
an
active,
a
name
and
a
uid,
but
if
we
would
actually
look
at
a
project,
it
also
contains
a
company
ID
in
this
case
we're
not
using
that
company
idea
at
all
because
it
doesn't
get
a
value
and
if
it
doesn't
get
a
value
to
no
property
and
it
won't
show
up
in
the
Json.
B
So
how
can
we
change
that?
Well,
I.
Have
this
optional
value,
Company
ID
here
and
when
I
create
a
post.
I.
Actually
check
is
compiled
me
id
if
it's
present
then
set
it
to
that
value.
So.
Currently
it
is
nil
and
it
won't
be
set,
but
it's
possible
to
do
here
is
that
you
basically
say
Okay
add
inject,
and
then
you
say
this
is
a
configuration
property.
B
B
And
then
we'll
just
make
it
automatically
injected
here
so
now,
if
I
would
run
this
application
again
and
if
I
would
post
a
new
value,
you
can
actually
see
here
that
suddenly
Company
ID
gets
filled
with
this
value.
So
it's
really
injected,
and
this
is
the
way
you
can
inject
your
URLs,
your
passwords,
whatever
you
need,
can
be
injected
this
way
in
to
your
code
now.
What
is
interesting
about
configuration,
for
instance,
is
that
in
version
2.0,
suddenly
you
have
the
possibility
to
Define
profiles
and
profiles.
B
Basically
saying
okay,
I
got
a
different
set
of
parameters
for
development,
for
test,
for
staging
and
for
production
and
I
can
have
all
these
values
in
my
environment
and
based
on
a
setting
mp.confactor
profile,
where
I
can
specify,
which
is
the
current
active
profile,
it
will
take
the
right
configuration
properties
that
really
makes
it
very
handy
to
use
and
and
and
very
easy
to
switch
environments.
B
So
there
was
a
great
addition
in
version
2.0,
another
edition
of
ones,
that
we
could
add
property
expressions
before
they
were
really
static,
and
now
we
can
have
in
our
properties
itself
have
Expressions,
which
is
really
nice
and
finally,
another
option
that
is
quite
usable
is
something
called
a
config
value,
because
I
just
told
you
there's
a
there's
all
these
sources,
where
I
probably
tell
you
can
come
from
and
sometimes
you're
just
not
getting
the
property
you
would
really
want
to
until
foreign.
B
B
B
B
B
Right
well,
moving
on
to
the
next
one.
We
have
our
API.
We
got
it
exposed
via
open
API.
We
got
the
application
configured,
so
the
next
Cloud
native
point
that
we
would
address
would
be
health,
and
that
would
be
the
health
of
your
application.
Your
service
can
actually
tell
outside
sources.
How
he's
doing
the
whole
idea
is
that,
with
the
health
surface,
you
check
the
validity,
the
availability
and
the
status
of
your
microservices.
B
There's
the
ready
endpoint,
which
basically
tells
you
is
my
business
logic,
ready
to
process
events.
There
is
the
life
and
point
that
Basics
is
my
Surface
still
responding
at
all,
so
it's
still
acting
as
I
would
expect
it
to
act
so
more
on
a
technical
level
as
opposed
to
the
Readiness
and
there's.
Finally,
a
startup
and
point
telling
to
the
outside
world
I'm,
actually
still
in
the
process
of
starting
up.
B
As
you
can
imagine,
all
these
endpoints
they're
really
machine
to
machine
endpoints
they're,
not
really
meant
for
us
use
this
to
to
to
to
check
them
all
the
time.
They're
really
meant
for
container
managers
like
humanitas
to
check
the
health
endpoints
and
see.
Do
I
need
to
restart
this
part,
because
it's
liveliness
and
point
really
doesn't
give
us
any
good
information
anymore.
So
that's
really
what
it's
meant
for
still.
We
need
to
implement
them
ourselves.
B
B
B
B
If
you
would
would
want
to
supply
extra
data,
maybe
they're
just
saying
I'm
having
a
problem
with
my
database,
so
I'm
trying
to
reach
the
reddit's
cash
and
it
gives
gives
a
problem
or
something
you
can
actually
make
it
available
to
the
outside
world.
As
additional
information
like
this,
so
you
can
add
an
unlimited
set
of
information
to
this
now,
even
though
we
implemented
the
health
check,
it
is
still
not
a
healthcare.
We
need
to
do
a
few
things.
B
B
Well,
with
all
these
added,
our
health
check
application
part
here
is
completed,
it
got
newly
deployed,
so
if
I
would
now
go
to
the
endpoint,
which
is
always
the
health
endpoint
in
a
project
which
is
at
the
surfer
name
and
then
health
and
I
would
run
it,
you
can
actually
hopefully
see
here
that
it
returned
the
information
that
we
gave
it.
So
it
still
says
my
status
is
up.
This
is
my
project
and
without
the
title
it
would
have
said,
I
am
not
available.
B
So
this
gives
you
really
really
nice
quick
information
and
on
how
your
system
is
doing
and
actually
it
gives
likely
an
container
Management
Systems
the
needed
application.
So
what
did
we
learn
from
this?
So
Health
Service
means
again
they're
CDI
beans,
in
this
case
application
scoped
the
need
to
return
a
health
check
response.
B
B
So
how
are
its?
How
is
the?
How
often
is
a
method
called
and
what
is
the
average
response
time
for
a
method
or
what
are
the
longest
delays?
B
You
know
all
these
kinds
of
metrics
and
for
that
there's
the
metrics
project
Within
micro
profile,
and
it
provides
us
with
a
number
of
metrics
that
we
can
apply
there's
the
times
annotation
that
has
all
kinds
of
information
about:
okay:
how
how
how
long
did
it
take
and
how
often
and
which
one
which
buckets
of
response
percentages
did
it
land
in
there's
the
counted
just
basically
saying:
okay,
how
often
have
I
been
invoked
and
there's
different
gauges
and
meters
and
histograms
that
we
can
use?
B
We
are
in
our
situation,
we're
going
to
just
look
at
a
few
of
these
and
going
back
to
our
resource
that
we
had
here
now.
We
might
want
to
know.
How
often
does
this
get
all
method?
How
often
does
it
get
cold
now?
Maybe
you
would
like
to
know
it
on
this
level,
where
you
say
this
is
really
I
just
want
to
know
how
often
it
gets
invoked,
and
it
is
really
as
simple
as
saying
I'm
doing
accounted
here.
B
B
B
B
So
this
was
for
this
very
specific
one
and
also
already
a
whole
lot
of
stuff
being
exported
by
default
by
your
running
application.
B
So
it
tells
you,
for
instance,
okay,
how
many
threats
are
running
into
in
the
system?
How
many
classes
did
the
class
loader
unload?
How
long
has
the
jvm
been
up?
So,
there's
a
lot
of
things
from
the
application
from
java
itself
that
is
actually
being
insupported
exported
and
where
you
can
either
use
them
or
you
can't.
B
But
it's
very
nice
if
you
want
to
see
okay,
what
CPU
usage
right
now
on
this
service,
how
much
this
space
is
left,
although
you
probably
have
to
add
that
one
in
yourself
how
much
memory
is
being
used
so
very,
very
useful
stuff
which
is
in
there
and
then
we're
gonna,
add
one
more
because
we
just
added
on
the
health
surface.
I'm,
sorry,
sorry,
on
a
project
service,
the
counted,
but
maybe
for
a
normal
call
to
get
all
I
would
like
to
know.
B
Also
let
you
know
the
turnaround
time
so
how
much
time
does
it
actually
take
for
the
complete
trip
to
complete
so
I'm,
getting
a
request
in
I'm
calling
the
back-end
service,
the
back-end
service,
retrieves
data
from
the
database
reports
it
back.
This
data
is
going
to
get
converted
into
Json
and
that
is
being
returned
to
the
client.
So
how
long
would
that
take?
B
Oh
there's,
another
indication
timed
again
with
this
annotation.
You
can
use
a
lot
of
a
lot
of
parameters
to
set
your
stuff
for,
for
specifically
for
your
metrics,
but
this
at
times
as
it
is
suffices
to
have
it
working
so
I'm
saving
this.
B
B
So
there's
a
lot
of
information
being
gathered
there
about
how
the
performance
of
your
system
is,
and
you
can
imagine
that,
if
you
look
at
these
figures
and
you'll
have
some
graphical
system
to
represent
them,
you
can
get
very,
very
good
insight
into
the
ongoing
performance
of
your
system
and
your
the
average
throughput
of
your
system,
so
metrics
very
important
to
make
your
application
more
visible
and
more
reliable,
see.
What's
going
on
on
the
inside.
B
But
now
something
might
sometimes
go
wrong
in
our
application.
Now
the
Health
Service
is
already
helping
us
part
there
right,
because,
basically
it
says:
okay
communities,
if,
if
you
think
I'm
not
doing
well
anymore,
I'll
tell
you
over
my
likeliness
service
and,
if
I'm
doing
really
bad,
please
restart
me,
and
that
is
what
kubernetes
will
do,
but
that's
kind
of
a
very
course
current
solution.
Isn't
it
I
mean
you,
don't
really
want
to
restart
your
complete
application
or
your
part
of
your
container
or
whatever,
just
because
there
might
be
some
hiccups
somewhere?
B
The
system
and
try
to
make
the
system
like
you
know,
self-correct
itself,
self
heal
itself.
Well.
For
this
there
is
default
tolerance,
module
within
micro
profile,
and
we
will
now
look
at
a
few
options
that
it
actually
offers
to
us
if
I
would
go
to
the
project
service
and
then
there
here
there
is
this
very
basic,
find
all
method
that
we've
just
had
before
I'm
just
taking
out
the
content.
B
Well,
the
most
basic
and
the
the
most
easy
option
would
be
that
you
gave
it
a
retry.
We
say
at
retry
and
you
state
the
number
of
times
it
should
retry
the
operation.
Should
it
fail?
B
B
Other
parameters
that
can
be
specified
like
Jitter,
which
is
some
kind
of
a
random
interval
where
it
will
wait
until
retrying
again,
but
basically
we'll
get
quite
a
long
way
by
just
specifying
what
we
have
here
now.
Should
these
1000
milliseconds.
B
B
B
So
this
is
a
really
powerful,
powerful
option
to
use,
because
you
really
can
give
the
system
some
time
with
the
delay-
yeah,
maybe
you're
kind
of
busy
right
now
or
you're
struggling
with
something
or
you
have
something
like
memory
that
is
being
reorganized
at
the
moment.
So
so
just
just
give
yourself
some
time
and
maybe
you'll
recover
yourself.
B
A
B
Limit
the
the
output
of
of
the
problems
that
are
occurring,
there's
another
pattern,
which
is
called
the
bulkhead
pattern,
which
is
basically
a
very
simple
pattern
and
there's
this
analogy
to
shipping.
Hence
the
name
bulkhead.
If
there's
a
big
container
ship
and
the
hole
gets
breached
because
it
touches
an
iceberg
or
whatever,
then,
if
nothing
has
been
done,
then
the
whole
ship
will
flood
with
water
and
it
will
eventually
sink.
B
If
we
would
have
all
these
methods
that
you
see
here,
these
five
methods,
and
only
to
find
all,
would
really
perform
very
badly
that
at
some
point,
all
the
threats
will
be
busy
with
processing
find
all
methods
that
the
rest
of
the
system
is
basically
starving
and
doesn't
get
any
response
anymore.
So,
there's
one
little
part
in
your
system
that
is
performing
badly,
maybe
because
you're
going
to
an
external
system,
it's
suddenly
kicking
down
your
complete
system
now
with
bulkhead
pattern.
Basically,
you
can
prevent
those
things.
There's
two
flavors
won't
go
too
much
into
them.
B
That's
the
semaphore
pattern
and
there's
the
threat
pool.
Basically,
here
the
semaphore
pattern
says:
Okay,
there's
only
five
maximum
concurrent
invocations
of
fine
find
all
so
that
that
five
calls
can
come
in
from
a
client
and
I
will
process
them.
I
won't
do
a
sixth
one.
Why
well,
if
we
have
a
thread
pool
for
20,
and
we
would
do
it
unlimited
then,
basically,
calls
would
come
in.
B
B
B
And
that
would
be
the
retry
I'll
show
you
not
to
retry.
Of
course,
that
would
be
the
fallback
and
what
the
fallback
basically
says
is:
okay,
if
there's
nothing,
I
can
do
anymore.
I
really
can't
reach
that
Source,
where
you
want
me
to
get
the
data
from
I
can
either
be
really
nasty
and
give
500
server,
error
or
I
can
just
be
a
bit
more
graceful.
Now,
let's
see
what's
happening,
if
we
don't
do
it
gracefully.
A
B
Of
30
milliseconds
and
then
we'll
just
make
the
system
a
bit
slower
machine.
We'll
do
a
threat
sleep
of
two
and
a
half
thousand
milliseconds
I.
Guess
you
can
imagine,
what's
going
to
happen,
the
system
will
say:
okay.
Well,
so
sorry
he
didn't
respond
in
time
and
something
is
wrong.
So
if
we
would
do
it
like
this
and
I
would
call
the
method.
B
A
B
B
B
B
Got
your
data:
maybe
you
got
your
data
somewhere
in
a
caching
system
and
you
could
say:
oh
well,
I'll
I'll
see
if
that
works
for
me,
so
I'll
just
return,
maybe
in
all
the
few,
but
still
better
than
giving
a
500..
Now
we
said
here
we
have
a
backup
method,
so
we
just
need
to
Define
one
here,
and
the
only
thing
is
that
is
important
is
that
it
should
have
returned
the
same
data
type
as
the
method.
It
is
a
backup
form.
So
in
this
case
we
would
say
list
project
backup
have
no
parameters.
B
B
B
B
So
this
was
the
end
of
the
presentation,
so
I
guess
now
is
a
good
time.
If
there
are
any
questions
there.
A
Is
thank
you
so
much
Ron
for
that
amazing
presentation
and
and
demo.
We
do
have
two
questions.
We
have
one
from
Helmut,
so
it's
if
you
have
a
real
database
as
backend,
would
you
use
at
ejb
annotations
instead
of
CDI.
B
Oh,
that's
a
very
interesting
question:
I
I
guess
it
really
depends
upon
because
agbs
in
the
old
type
in
the
old
style,
there
were
like
two
things:
there
were
like
surfaces
and
there
would
also
be
persistence.
Persistence
is
now
separately
in
this
case.
I
think
I
would
even
if
I
had
a
real
database.
I
would
still
use
our
normal
things
that
we're
using
right
now.
The
way
I
used
it
now,
because
there
we
also
can
have
transactions
in
there.
B
So
there's
no
reason
to
use
agbs
I
can
see
why
you
want
to
want
to
do
that,
but
you
can
use
the
same
I
understand
because
there's
also
a
Singleton
scope,
Within
AGB
beans,
that
kind
of
compare
to
the
application
scope,
but
you
can
use
basically
both
it
really
depends
also
if
you
would
go
to
the
core
profile
that
I
was
showing
before
I'll
just
pick
it
up.
Here
we
have
this
core
profile
on
the
right.
Basically,
beans
are
no
longer
part
of
that.
B
A
Okay,
great
and
another
question
from
the
same
same
person
is:
is
it
possible
to
react
in
a
Health,
Service,
System,
metrics,
P,
dot
e
force
a
reboots
by
marking
a
system
as
down?
If
the
memory
footprint
surpasses
a
limit.
B
Yes,
what
you
you
could
force
a
reboot
of
course,
because
you
have
all
these
metrics
available.
You
can
even
inject
them
individual,
metrics
and
or
retrieve
them
from
the
metrics
registry,
and
what
you
could
do
in
your
Health.
Service,
of
course,
is
go
to
this
magic
registry.
Look
at
okay!
What's
my
current
memory
footprint?
Is
it
below
a
threshold?
B
Then
I'll
just
return,
not
the
up
like
I
did
before,
but
we
turned
it
down
and
the
down
would
then
be
an
indicator
to
The
Container
management
platform
like
kubernetes
to
say:
oh,
wait,
a
minute.
You
gave
me
a
down,
then
I'll
automatically
reboot
the
container,
so
it
would
still
be
like
the
container
management
platform
that
would
do
the
reboot,
but
you
can
actually
give
it
an
indication
saying:
let's
reboot,
yes,
definitely
question.
A
B
Yeah,
that
is
actually
also
a
very
good
question
helmet.
Let
me
show
you
one
example
that
I
didn't
even
get
to,
but
I
would
really
love
to
show
I'm
just
taking
out
everything.
I
had
here,
go
back
to
the
original
one
and
then
because
I
just
showed
them
in
all
individually,
but
it
is
actually
very
very
possible
to
to
have
all
these
things
run
together
as
one
one
one
big
group
of
set
that
is
running
in
in
conjunction.
So
let's
look
at
this
code
here.
B
Basically,
I
got
a
circuit
breaker,
a
retry,
the
bulkhead
and
the
timeout,
and
a
fallback
method
so
that
that
they're
all
in
there
right
so
first,
what
happens
is
we
get
to
this
message
find
all
and
the
circuit
breaker
will
first
check?
Is
the
circuit
open?
If
the
circuit
is
open,
no
traffic
will
flow
to
it
and
it
will
find
a
different
method
now
if
it
is
not
open
but
close,
that
means
the
traffic
will
go
through
and
the
bulkhead
the
timeout
will
actually
start.
B
B
If
it
isn't,
then
it
will
just
execute
as
normal.
If
it
would
be,
if
the
bulkhead
would
say
no,
we
can't
do
it
right
now,
because
all
the
fats
are
used,
it
will
actually
throw
a
bulkhead
exception
which
will
then
be
caught.
B
And
then
the
retry
will
take
over
again,
and
this
continues
to
work
in
conjunction,
so
they
keep
working
like
this.
The
circuit
breaker
might
go
open
it.
It
will
retry
again
and
in
the
end,
if
we
can't
get
a
decent
result,
it
will
go
to
the
fallback
method.
So
long
answer
to
the
question:
yes,
it
can
fix
it.
The
circuit
breaker
will
throw
an
exception,
but
if
you
use
them
in
conjunction,
then
you
actually
might
have
automatic
fixtures
in
place.
A
Okay,
great,
it
doesn't
look
like
there's
any
other
questions,
so
we're
also
looking
to
book
some
more
Jakarta
Tech
talks
through
2023.
So
if
anyone
is
interested,
I
did
link
the
form
in
the
chat.
And
finally,
if
you
have
any
feedback
on
the
tech
talk
programs,
we
would
love
to
hear
from
you.
So
when
we
close
out
this
chart
you're
going
to
get
a
little
thumbs
up
or
red
thumbs
down-
and
just
you
know,
give
us
some
feedback.
A
If
you
enjoyed
this
talk
and
and
if
you've
and
if
not,
you
can
also
give
us
some
feedback
on
ways
that
we
can
improve.
So
I
just
want
to
say
thank
you
so
much
Ron
again,
and
everyone
for
attending
and
I
hope
you
all
have
a
wonderful
day.