WEBVTT

1
00:00:00.160 --> 00:00:04.919
<v Speaker 1>Building modern software applications today. Wow, it often feels like

2
00:00:04.960 --> 00:00:09.720
<v Speaker 1>you're trying to navigate this this vast, ever expanding ocean,

3
00:00:09.720 --> 00:00:10.240
<v Speaker 1>doesn't it.

4
00:00:10.240 --> 00:00:13.279
<v Speaker 2>It really does. Frameworks, patterns, deployment strategies.

5
00:00:13.400 --> 00:00:15.960
<v Speaker 1>Yeah, the sheer volume can be overwhelming if you're trying

6
00:00:15.960 --> 00:00:21.039
<v Speaker 1>to stay informed and you know, build genuinely robust system.

7
00:00:20.800 --> 00:00:24.440
<v Speaker 2>Absolutely, the landscape just shifts constantly, trying to keep up

8
00:00:24.440 --> 00:00:25.480
<v Speaker 2>with every single new thing.

9
00:00:25.519 --> 00:00:28.559
<v Speaker 1>It's well, it leads to information overload pretty fast.

10
00:00:28.440 --> 00:00:31.399
<v Speaker 2>Right, which is why having a guide, some kind of

11
00:00:31.480 --> 00:00:32.560
<v Speaker 2>compass is just so.

12
00:00:32.679 --> 00:00:35.079
<v Speaker 1>Crucial exactly to cut through all the noise.

13
00:00:35.719 --> 00:00:38.000
<v Speaker 2>And that's exactly what we're bringing you today. We're diving

14
00:00:38.039 --> 00:00:41.840
<v Speaker 2>headfirst into the core of modern application development. We're pulling

15
00:00:41.880 --> 00:00:44.960
<v Speaker 2>out the really important nuggets from pro spring Boot three

16
00:00:45.000 --> 00:00:47.520
<v Speaker 2>with Cotlin, And this isn't just about code, right, It's

17
00:00:47.520 --> 00:00:51.799
<v Speaker 2>about understanding the why and the how behind these powerful

18
00:00:51.840 --> 00:00:54.960
<v Speaker 2>tools that honestly make a lot of the Internet just work.

19
00:00:55.039 --> 00:00:57.920
<v Speaker 1>And what's great here the source material comes from real experts,

20
00:00:58.000 --> 00:01:01.719
<v Speaker 1>Peter Spieth and Felid Gutierra and Febe brings insights straight

21
00:01:01.719 --> 00:01:04.319
<v Speaker 1>from VM where you know, the folks who actually create

22
00:01:04.640 --> 00:01:07.519
<v Speaker 1>spring boot. Wow. Okay, so straight from the.

23
00:01:07.480 --> 00:01:10.319
<v Speaker 2>Source, pretty much distilled down for clarity.

24
00:01:10.959 --> 00:01:13.439
<v Speaker 1>So our mission for this deep dive is really to

25
00:01:13.519 --> 00:01:17.680
<v Speaker 1>unpack how spring Boot, especially with Cotlin, takes these inherently

26
00:01:17.760 --> 00:01:24.079
<v Speaker 1>complex software development tasks and just simplifies them, radically simplifies them.

27
00:01:24.239 --> 00:01:27.079
<v Speaker 2>Yeah, show how it delivers these like surprising features right

28
00:01:27.120 --> 00:01:28.079
<v Speaker 2>out of the box.

29
00:01:27.920 --> 00:01:32.040
<v Speaker 1>Exactly and helps developers like you build apps that are fast,

30
00:01:32.120 --> 00:01:35.319
<v Speaker 1>secure and crucially observable and ready for the.

31
00:01:35.280 --> 00:01:38.959
<v Speaker 2>Cloud get ready for some aha moments. I think it

32
00:01:38.959 --> 00:01:41.239
<v Speaker 2>can really shift how you view building apps.

33
00:01:41.359 --> 00:01:44.040
<v Speaker 1>Think of this as your shortcut. We're cutting through the jargon,

34
00:01:44.200 --> 00:01:46.920
<v Speaker 1>getting straight to what's genuinely important.

35
00:01:46.680 --> 00:01:48.640
<v Speaker 2>And how you can actually apply to your own work

36
00:01:48.799 --> 00:01:50.079
<v Speaker 2>right pretty much immediately.

37
00:01:50.200 --> 00:01:56.079
<v Speaker 1>Okay, let's start with Springboot's core promise, then simplification and opinionation.

38
00:01:56.359 --> 00:01:59.000
<v Speaker 1>So why spring Boot. The book makes it clear it's

39
00:01:59.079 --> 00:02:02.000
<v Speaker 1>designed ground to be enterprise ready.

40
00:02:01.799 --> 00:02:04.280
<v Speaker 2>Right with best practices just applied automatically.

41
00:02:04.400 --> 00:02:05.040
<v Speaker 1>And that's the key.

42
00:02:05.159 --> 00:02:07.760
<v Speaker 2>That's the key. The biggest advantage honestly, and it's a

43
00:02:07.799 --> 00:02:12.319
<v Speaker 2>game changer for productivity, is that opinionated nature, meaning it.

44
00:02:12.319 --> 00:02:15.599
<v Speaker 1>Makes choices for you sensible defaults.

45
00:02:15.080 --> 00:02:18.400
<v Speaker 2>Exactly, sensible defaults, yeah, which leads to what the authors

46
00:02:18.439 --> 00:02:20.520
<v Speaker 2>call sometimes zero configuration.

47
00:02:21.000 --> 00:02:24.479
<v Speaker 1>Zero configuration. Okay, that sounds almost too good to be true.

48
00:02:24.759 --> 00:02:26.319
<v Speaker 1>How much pain does that actually save?

49
00:02:26.639 --> 00:02:29.080
<v Speaker 2>Well, think about the old days, right, all that XML

50
00:02:29.400 --> 00:02:31.759
<v Speaker 2>or just tons of Java configu code just to get

51
00:02:31.800 --> 00:02:34.479
<v Speaker 2>a basic web app talking to a database.

52
00:02:34.560 --> 00:02:36.919
<v Speaker 1>Oh yeah, hours, sometimes days.

53
00:02:37.120 --> 00:02:40.719
<v Speaker 2>Spring boots autoconfiguration isn't just convenient, it's like the whole

54
00:02:40.719 --> 00:02:43.400
<v Speaker 2>paradigm shift. It means you can focus on your actual

55
00:02:43.439 --> 00:02:45.199
<v Speaker 2>business logic, like from day.

56
00:02:45.039 --> 00:02:48.439
<v Speaker 1>One, trusting the framework to wire up most of the infrastructure.

57
00:02:48.479 --> 00:02:51.680
<v Speaker 2>Yeah, like ninety percent of it intelligently. It frees you

58
00:02:51.719 --> 00:02:54.879
<v Speaker 2>from that boiler plate, letting you build complex stuff without

59
00:02:54.879 --> 00:02:56.680
<v Speaker 2>getting bogged down and repetitive setup.

60
00:02:56.800 --> 00:02:59.599
<v Speaker 1>That is a huge claim about productivity. But does that

61
00:02:59.639 --> 00:03:03.560
<v Speaker 1>opinionated nature does it ever become a limitation? Do those

62
00:03:03.639 --> 00:03:05.039
<v Speaker 1>defaults ever get in your way?

63
00:03:05.280 --> 00:03:07.719
<v Speaker 2>It's a fair question. I mean, while it massively cuts

64
00:03:07.759 --> 00:03:11.759
<v Speaker 2>down initial development time, sure there are times you need finer.

65
00:03:11.520 --> 00:03:13.479
<v Speaker 1>Control, but you can override things.

66
00:03:13.800 --> 00:03:16.479
<v Speaker 2>Oh yeah, absolutely. Springboot is designed to let you step

67
00:03:16.520 --> 00:03:19.960
<v Speaker 2>in and override defaults pretty easily when you need to. Okay,

68
00:03:20.479 --> 00:03:23.719
<v Speaker 2>and connecting this to the bigger picture, this whole approach

69
00:03:23.800 --> 00:03:28.240
<v Speaker 2>also makes Springboot perfect for cloud native applications. It follows

70
00:03:28.240 --> 00:03:31.479
<v Speaker 2>those twelve factor app principles right.

71
00:03:31.400 --> 00:03:34.080
<v Speaker 1>The best practices for building scalable cloud.

72
00:03:33.759 --> 00:03:38.800
<v Speaker 2>Apps exactly, things like dependency management, logging, config It handles

73
00:03:38.840 --> 00:03:41.240
<v Speaker 2>that well. And it also sets you up for native

74
00:03:41.280 --> 00:03:45.080
<v Speaker 2>images using AOT compilation with Grail VM.

75
00:03:45.159 --> 00:03:47.680
<v Speaker 1>Which is huge for performance in the cloud. We'll definitely

76
00:03:47.680 --> 00:03:50.000
<v Speaker 1>circle back to that, but let's stick into the magic

77
00:03:50.039 --> 00:03:53.400
<v Speaker 1>a bit more. How does this autoconfiguration actually work? What

78
00:03:53.439 --> 00:03:54.840
<v Speaker 1>happens when I run my app?

79
00:03:55.120 --> 00:03:57.439
<v Speaker 2>So it all kicks off with the spring application class

80
00:03:57.680 --> 00:04:01.240
<v Speaker 2>in Cotland. Your main method basically run this singleton, okay,

81
00:04:01.520 --> 00:04:04.360
<v Speaker 2>but the real powerhouse, the thing you see everywhere is

82
00:04:04.400 --> 00:04:06.280
<v Speaker 2>the at spring boot application.

83
00:04:05.840 --> 00:04:08.199
<v Speaker 1>Annotation right, that one annotation, yeah.

84
00:04:08.000 --> 00:04:10.680
<v Speaker 2>And it's actually an alias for three other critical ones

85
00:04:10.960 --> 00:04:14.159
<v Speaker 2>You've got at spring boot configuration, which marks the class

86
00:04:14.199 --> 00:04:18.079
<v Speaker 2>as a config source. At enable autoconfiguration, which is the

87
00:04:18.079 --> 00:04:21.759
<v Speaker 2>trigger really. It starts the autoconfig based on what dependencies

88
00:04:21.800 --> 00:04:23.040
<v Speaker 2>it finds on your class path.

89
00:04:23.120 --> 00:04:25.240
<v Speaker 1>Ah, so it looks at my library exactly.

90
00:04:25.600 --> 00:04:28.120
<v Speaker 2>And the third is that component scan which finds your

91
00:04:28.120 --> 00:04:30.639
<v Speaker 2>own components, your controllers, services, that kind of thing.

92
00:04:30.800 --> 00:04:34.240
<v Speaker 1>So if I just add, say the post Rascal driver

93
00:04:34.319 --> 00:04:38.000
<v Speaker 1>dependency to my project. Yep, springboot sees that and just

94
00:04:38.639 --> 00:04:42.040
<v Speaker 1>sets up a data source and maybe a transaction manager

95
00:04:42.959 --> 00:04:44.519
<v Speaker 1>without me writing any code for it.

96
00:04:44.600 --> 00:04:47.199
<v Speaker 2>That's precisely it. It sounds like a dream, but it works.

97
00:04:47.319 --> 00:04:52.199
<v Speaker 2>It configures essentials, transaction manager for transactions, entity manager, factory

98
00:04:52.199 --> 00:04:55.680
<v Speaker 2>if you're using JPA, the data source for connections, message

99
00:04:55.680 --> 00:04:59.319
<v Speaker 2>converters for web stuff, even resource handler registry for static files.

100
00:04:59.399 --> 00:05:01.480
<v Speaker 1>All that plumbing just handled, all.

101
00:05:01.279 --> 00:05:04.360
<v Speaker 2>Handled without XML, without manual Java config beans most of

102
00:05:04.399 --> 00:05:04.759
<v Speaker 2>the time.

103
00:05:04.920 --> 00:05:08.439
<v Speaker 1>That's genuinely impressive. But what if I don't want one

104
00:05:08.480 --> 00:05:10.920
<v Speaker 1>of those defaults. Say I have a really custom setup

105
00:05:10.959 --> 00:05:12.040
<v Speaker 1>for web stuff, you can.

106
00:05:11.920 --> 00:05:16.079
<v Speaker 2>Definitely control it that it enables autoconfiguration annotation, it has

107
00:05:16.279 --> 00:05:19.600
<v Speaker 2>exclude and exclude name parameters. Ah okay, So if you

108
00:05:19.639 --> 00:05:22.920
<v Speaker 2>didn't want the standard WEBNBC setup, you could just say

109
00:05:23.079 --> 00:05:28.160
<v Speaker 2>exclude array of WEBMVC, autoconfiguration dot class. So you get

110
00:05:28.160 --> 00:05:30.079
<v Speaker 2>the convenience, but you still have control.

111
00:05:30.160 --> 00:05:33.920
<v Speaker 1>That's a good balance, okay. Shifting gears slightly. The book

112
00:05:33.959 --> 00:05:37.680
<v Speaker 1>talks about personalizing your app beyond the core configuration. I

113
00:05:37.720 --> 00:05:40.040
<v Speaker 1>was kind of amused by the custom banner thing.

114
00:05:40.240 --> 00:05:42.519
<v Speaker 2>Yeah, it's a small touch, but it shows the level

115
00:05:42.560 --> 00:05:45.199
<v Speaker 2>of detail instead of the default spring boot ask.

116
00:05:45.240 --> 00:05:47.720
<v Speaker 1>Art, which is iconic but maybe not for every app.

117
00:05:47.800 --> 00:05:50.319
<v Speaker 2>Right, you can just drop a banner dot txt file

118
00:05:50.720 --> 00:05:53.600
<v Speaker 2>in src in main resources or set the spring dot

119
00:05:53.639 --> 00:05:55.000
<v Speaker 2>banner dot location property.

120
00:05:55.000 --> 00:05:58.879
<v Speaker 1>You can even use online generators right like patoorjk dot com.

121
00:05:58.839 --> 00:06:01.720
<v Speaker 2>Yep makes something unique, or just turn it off completely

122
00:06:01.759 --> 00:06:05.560
<v Speaker 2>with banner mode doff. It's simple but nice to have

123
00:06:05.600 --> 00:06:06.000
<v Speaker 2>that option.

124
00:06:06.160 --> 00:06:09.199
<v Speaker 1>So even the visual startup is configurable. What about passing

125
00:06:09.319 --> 00:06:12.800
<v Speaker 1>arguments when you launch the app for different modes or environments?

126
00:06:12.800 --> 00:06:15.639
<v Speaker 2>Spring good makes that super easy with the Application Arguments interface.

127
00:06:15.680 --> 00:06:15.920
<v Speaker 1>Okay.

128
00:06:16.079 --> 00:06:18.920
<v Speaker 2>Lets you easily grab both option arguments you know, things

129
00:06:18.959 --> 00:06:23.079
<v Speaker 2>like enable or option value one exactly, and also non

130
00:06:23.120 --> 00:06:27.639
<v Speaker 2>option arguments maybe like command words update or upgrade. Really

131
00:06:27.759 --> 00:06:29.839
<v Speaker 2>useful for passing parameters at run time?

132
00:06:30.040 --> 00:06:33.040
<v Speaker 1>And what about the app's life cycle? Are there hooks

133
00:06:33.079 --> 00:06:35.879
<v Speaker 1>for running code at specific startup points?

134
00:06:36.160 --> 00:06:40.160
<v Speaker 2>Yes, and there's a clear order. First, application runner gets

135
00:06:40.160 --> 00:06:44.040
<v Speaker 2>called it gets those nice parsed application arguments. Then command

136
00:06:44.120 --> 00:06:46.639
<v Speaker 2>line runner runs it gets the rostering arguments if you

137
00:06:46.680 --> 00:06:47.560
<v Speaker 2>need those for some reason.

138
00:06:47.720 --> 00:06:50.319
<v Speaker 1>The final signal the.

139
00:06:49.800 --> 00:06:53.160
<v Speaker 2>Very last event signaling everything's initialized and ready to go.

140
00:06:53.560 --> 00:06:56.920
<v Speaker 2>Is the application ready event? Understanding that sequence helps you

141
00:06:56.959 --> 00:06:58.800
<v Speaker 2>plug in custom logic at the right time.

142
00:06:58.920 --> 00:07:01.480
<v Speaker 1>That's a clear progression. Good to know. But once the

143
00:07:01.480 --> 00:07:04.360
<v Speaker 1>app's running, how do we handle settings? You know, avoid

144
00:07:04.399 --> 00:07:08.279
<v Speaker 1>hardcoding data based passwords everywhere. Let's get into configuration management.

145
00:07:08.360 --> 00:07:11.639
<v Speaker 2>Okay, For basic single properties, you can just inject them

146
00:07:11.759 --> 00:07:13.560
<v Speaker 2>using at value property.

147
00:07:13.199 --> 00:07:16.480
<v Speaker 1>Name right, using that Spring expression language to an el exactly.

148
00:07:16.519 --> 00:07:18.560
<v Speaker 2>Spitteel gives you a lot of power there. It pulls

149
00:07:18.680 --> 00:07:22.040
<v Speaker 2>values straight from your application dot properties or application dot

150
00:07:22.079 --> 00:07:22.879
<v Speaker 2>EML file.

151
00:07:23.120 --> 00:07:25.199
<v Speaker 1>But what if I have a bunch of related settings,

152
00:07:25.240 --> 00:07:29.879
<v Speaker 1>like all the connection details for some service, server, port, username,

153
00:07:31.399 --> 00:07:33.759
<v Speaker 1>at value for each one seems messy?

154
00:07:33.839 --> 00:07:36.360
<v Speaker 2>It would get messy fast. And that's where at configuration

155
00:07:36.480 --> 00:07:39.319
<v Speaker 2>properties is fantastic. You can bind a whole group of

156
00:07:39.360 --> 00:07:42.120
<v Speaker 2>properties like users, dot serve, dot server, users, dot service,

157
00:07:42.160 --> 00:07:46.040
<v Speaker 2>dot port all into a single type safe class. Keeps

158
00:07:46.040 --> 00:07:49.800
<v Speaker 2>things super clean and organized much better for maintainability.

159
00:07:49.959 --> 00:07:53.240
<v Speaker 1>Nice And where did these properties actually come from? Is

160
00:07:53.240 --> 00:07:57.600
<v Speaker 1>there a hierarchy? Like can an environment variable override something

161
00:07:57.639 --> 00:07:59.000
<v Speaker 1>in my packaged application?

162
00:07:59.120 --> 00:08:02.720
<v Speaker 2>Absolutely? And that's crue. Spring boot looks in multiple places

163
00:08:02.759 --> 00:08:05.879
<v Speaker 2>application dot properties inside your jar first, then it looks

164
00:08:05.879 --> 00:08:09.399
<v Speaker 2>for the same file outside the jar. Then environment variables,

165
00:08:09.399 --> 00:08:12.519
<v Speaker 2>command line arguments, and the later ones win exactly. External

166
00:08:12.519 --> 00:08:15.959
<v Speaker 2>sources always overwrite internal ones. So yes, an environment variable

167
00:08:16.000 --> 00:08:18.519
<v Speaker 2>set in your deployment will trump a value inside the jar.

168
00:08:18.879 --> 00:08:20.480
<v Speaker 2>Super useful for different environments.

169
00:08:20.519 --> 00:08:24.240
<v Speaker 1>Takes total sense for cloud deployments and specifically for web apps.

170
00:08:24.240 --> 00:08:26.680
<v Speaker 1>How does boot know whether to set up, for say, Tomcat,

171
00:08:26.759 --> 00:08:28.040
<v Speaker 1>or for reactive netty.

172
00:08:28.199 --> 00:08:31.399
<v Speaker 2>It smartly adapts based on your dependencies. If it sees

173
00:08:31.600 --> 00:08:36.159
<v Speaker 2>Spring Bootstarter web, it assumes web application type servlet traditional

174
00:08:36.200 --> 00:08:39.120
<v Speaker 2>blocking IO, usually with embedded Tomcat, okay. But if it

175
00:08:39.159 --> 00:08:42.320
<v Speaker 2>find Spring Bootstarter web flux, it switches to web application

176
00:08:42.399 --> 00:08:46.960
<v Speaker 2>type reactive, typically using Netty underneath for non blocking reactive handling.

177
00:08:47.039 --> 00:08:49.519
<v Speaker 1>So it just figures it out based on what you include.

178
00:08:49.559 --> 00:08:50.960
<v Speaker 2>GEP adapts seamlessly.

179
00:08:51.120 --> 00:08:54.639
<v Speaker 1>Okay, that's flexible. Let's shift now to actually building things

180
00:08:54.720 --> 00:08:59.919
<v Speaker 1>web development. First, classic question, at controller versus at rest control?

181
00:09:00.360 --> 00:09:00.960
<v Speaker 1>What's the deal?

182
00:09:01.039 --> 00:09:03.440
<v Speaker 2>Right? At rest controller is basically just a shortcut. It

183
00:09:03.600 --> 00:09:06.159
<v Speaker 2>combines at controller with at response body.

184
00:09:06.240 --> 00:09:07.960
<v Speaker 1>Okay, and what does that response body do? Again?

185
00:09:08.000 --> 00:09:10.840
<v Speaker 2>It tells Spring that the return value of your method

186
00:09:11.039 --> 00:09:14.320
<v Speaker 2>should be bound directly to the web response body, usually

187
00:09:14.360 --> 00:09:16.679
<v Speaker 2>serialized as JSON by default.

188
00:09:16.840 --> 00:09:19.519
<v Speaker 1>So at rest controller implies you're building an API that

189
00:09:19.600 --> 00:09:21.399
<v Speaker 1>returns data like JSON.

190
00:09:21.679 --> 00:09:24.440
<v Speaker 2>Exactly. If you used a plane at controller, you typically

191
00:09:24.519 --> 00:09:27.639
<v Speaker 2>return like a view name for rendering HTML. If you

192
00:09:27.679 --> 00:09:30.919
<v Speaker 2>wanted that controller to return JSON, you'd have to add

193
00:09:30.960 --> 00:09:35.080
<v Speaker 2>at response body yourself. So for rest APIs at rest

194
00:09:35.080 --> 00:09:36.720
<v Speaker 2>controller is almost always what you want.

195
00:09:36.799 --> 00:09:41.600
<v Speaker 1>Got it that clears it up and static content HTML, CSS, JavaScript?

196
00:09:41.600 --> 00:09:43.799
<v Speaker 1>Do I need a Patchy or Niekens in front Nope.

197
00:09:43.960 --> 00:09:47.440
<v Speaker 2>Spring boot handles it automatically. It serves static content from

198
00:09:47.440 --> 00:09:51.399
<v Speaker 2>standard locations in your class path, static public resources, or

199
00:09:51.480 --> 00:09:52.600
<v Speaker 2>meta in free sources.

200
00:09:52.639 --> 00:09:54.039
<v Speaker 1>So I just put my files there.

201
00:09:54.120 --> 00:09:55.519
<v Speaker 2>Just put them there, and if you have an index

202
00:09:55.559 --> 00:09:57.840
<v Speaker 2>dot html in one of those spots, boom, that's your

203
00:09:57.840 --> 00:09:59.960
<v Speaker 2>home page. No extra config needed.

204
00:10:00.200 --> 00:10:04.000
<v Speaker 1>Super handy. How about response formats like automatically getting JSON

205
00:10:04.200 --> 00:10:06.279
<v Speaker 1>or maybe XML if a client asks for it.

206
00:10:06.480 --> 00:10:10.080
<v Speaker 2>That's handled by HTPP message converters. Spring Boot sets these

207
00:10:10.159 --> 00:10:12.399
<v Speaker 2>up for you. Jason works out of the box because

208
00:10:12.399 --> 00:10:15.600
<v Speaker 2>the Jackson library is included with the webstarter and XML.

209
00:10:15.840 --> 00:10:19.039
<v Speaker 2>If you add the Jackson XML extension dependency. Boot will

210
00:10:19.080 --> 00:10:22.879
<v Speaker 2>automatically configure an XML converter two. Then it uses content

211
00:10:22.960 --> 00:10:25.799
<v Speaker 2>negotiation based on the clients accept hitter to decide whether

212
00:10:25.840 --> 00:10:27.960
<v Speaker 2>to send Jason or XML pretty.

213
00:10:27.679 --> 00:10:32.200
<v Speaker 1>Smart okay, and can I tweak that Jason Serialization dates,

214
00:10:32.200 --> 00:10:35.000
<v Speaker 1>for instance, can be formatted weirdly sometimes.

215
00:10:34.600 --> 00:10:38.440
<v Speaker 2>Yep, easy fix. The default is a long ISO eight

216
00:10:38.480 --> 00:10:41.200
<v Speaker 2>six oh one ish format, but you can change it

217
00:10:41.240 --> 00:10:45.159
<v Speaker 2>globally with the spring dot Jackson dot datebomat property in

218
00:10:45.240 --> 00:10:48.720
<v Speaker 2>application dot properties tailor it. However, you need.

219
00:10:48.840 --> 00:10:53.440
<v Speaker 1>Good What about validating incoming data? Preventing bad data before

220
00:10:53.480 --> 00:10:54.639
<v Speaker 1>it even hits my logic?

221
00:10:54.759 --> 00:10:59.120
<v Speaker 2>Absolutely essential? Spring Boot integrates smoothly with the Jakarta validation API.

222
00:10:58.879 --> 00:11:01.519
<v Speaker 1>So I can use annotation like at n blank exactly

223
00:11:01.600 --> 00:11:04.120
<v Speaker 1>and not blank at not null at email at size,

224
00:11:04.279 --> 00:11:06.440
<v Speaker 1>put them right on the fields of your request objects.

225
00:11:06.639 --> 00:11:10.519
<v Speaker 2>If validation fails, spring Boot automatically handles it, usually returning

226
00:11:10.519 --> 00:11:14.320
<v Speaker 2>a four hundred bad request with details. Keeps bad data out.

227
00:11:14.279 --> 00:11:17.399
<v Speaker 1>And broader error handling. If something unexpected blows up deeper

228
00:11:17.399 --> 00:11:19.320
<v Speaker 1>in my code, how do I give a clean error.

229
00:11:19.240 --> 00:11:21.960
<v Speaker 2>Response for that? You use at controller advice along with

230
00:11:22.039 --> 00:11:25.919
<v Speaker 2>at exception handler. This lets you centralize your exception handling logic.

231
00:11:25.720 --> 00:11:27.879
<v Speaker 1>So one place to catch specific exceptions.

232
00:11:28.159 --> 00:11:31.559
<v Speaker 2>Right, you can catch a custom retroboard not found exception

233
00:11:31.639 --> 00:11:35.600
<v Speaker 2>for example, and format a nice consistent Jason error response

234
00:11:35.799 --> 00:11:38.840
<v Speaker 2>across your whole API. Keeps your controllers cleaner.

235
00:11:39.279 --> 00:11:42.320
<v Speaker 1>Okay, that makes sense. And mapping request to controller methods

236
00:11:42.399 --> 00:11:45.080
<v Speaker 1>still the usual suspects like at get mapping, YEP at.

237
00:11:44.919 --> 00:11:47.039
<v Speaker 2>Request mapping is the general one, but you'll mostly use

238
00:11:47.080 --> 00:11:50.519
<v Speaker 2>the specifics at get mapping, at post mapping, at put mapping,

239
00:11:50.519 --> 00:11:54.000
<v Speaker 2>at delete mapping. They map directly to the HDDP methods.

240
00:11:53.679 --> 00:11:55.759
<v Speaker 1>And they support things like path variable.

241
00:11:55.879 --> 00:11:58.960
<v Speaker 2>Oh yeah, pathvariables like email to pull values from the URL,

242
00:11:59.159 --> 00:12:02.279
<v Speaker 2>plus flexibly use URL patterns using wild cards. You can

243
00:12:02.279 --> 00:12:05.360
<v Speaker 2>also use response entity to have full control over the response,

244
00:12:05.559 --> 00:12:07.320
<v Speaker 2>including headers like location.

245
00:12:07.440 --> 00:12:11.840
<v Speaker 1>After creating something cool, okay, weblayer covered Now data Every

246
00:12:11.879 --> 00:12:15.559
<v Speaker 1>app needs data persistence. How does boot simplify sl and

247
00:12:15.600 --> 00:12:19.320
<v Speaker 1>no SQL databases? Let's start with SQL for SQL.

248
00:12:19.399 --> 00:12:21.840
<v Speaker 2>The moment you add a database driver like the Postgres

249
00:12:21.879 --> 00:12:25.240
<v Speaker 2>school one or do postgrisk, Correll, dot PRIs, aggressive, zeris

250
00:12:25.240 --> 00:12:28.519
<v Speaker 2>growth counter Spring Boot auto configures.

251
00:12:28.039 --> 00:12:29.679
<v Speaker 1>Things like the data source exactly.

252
00:12:29.759 --> 00:12:32.200
<v Speaker 2>It sets up the data source and configures an efficient

253
00:12:32.200 --> 00:12:36.320
<v Speaker 2>connection pool usually high CARICP by default without you doing anything.

254
00:12:36.519 --> 00:12:39.759
<v Speaker 1>Wow, okay, no manual connection pool setup Nope.

255
00:12:39.879 --> 00:12:42.360
<v Speaker 2>Saves a ton of boiler plate and ensures good performance

256
00:12:42.480 --> 00:12:42.960
<v Speaker 2>right away.

257
00:12:43.279 --> 00:12:45.840
<v Speaker 1>And what else does the framework offer for SQL?

258
00:12:45.960 --> 00:12:48.919
<v Speaker 2>Well, the broader Spring framework gives you transaction management, so

259
00:12:48.960 --> 00:12:53.000
<v Speaker 2>you can just annotate methods with at transactional and JDBC template,

260
00:12:53.000 --> 00:12:56.240
<v Speaker 2>which massively simplifies raw JDBC code if you need to

261
00:12:56.240 --> 00:12:59.360
<v Speaker 2>go that low level removes all that trycatch finally.

262
00:12:59.000 --> 00:13:02.039
<v Speaker 1>Mess right the plan reduction again? What about setting up

263
00:13:02.039 --> 00:13:05.759
<v Speaker 1>the database schema initially, especially for testing or local dev

264
00:13:05.799 --> 00:13:07.159
<v Speaker 1>with embedded databases.

265
00:13:07.200 --> 00:13:11.919
<v Speaker 2>Boot can auto initialize embedded databases like H two hsql derby.

266
00:13:12.159 --> 00:13:15.159
<v Speaker 2>It looks for schema dot sql to create tables and

267
00:13:15.279 --> 00:13:17.799
<v Speaker 2>data dot sql to populate them in your class path.

268
00:13:17.840 --> 00:13:18.480
<v Speaker 1>Oh nice.

269
00:13:18.559 --> 00:13:21.159
<v Speaker 2>It's even smart enough to look for platform specific scripts

270
00:13:21.320 --> 00:13:24.320
<v Speaker 2>like schema dash H two dot sql or Schema dash

271
00:13:24.360 --> 00:13:28.159
<v Speaker 2>postrescl dot sql. You can control which platform it uses

272
00:13:28.320 --> 00:13:31.320
<v Speaker 2>with Spring dot sql dot in it dot platform.

273
00:13:31.399 --> 00:13:33.679
<v Speaker 1>Very convenient for quick starts. Okay, moving up a level

274
00:13:33.679 --> 00:13:36.480
<v Speaker 1>to Spring data, that's a big deal. What's the core idea? There.

275
00:13:36.799 --> 00:13:41.720
<v Speaker 2>Spring Data revolves around repository interfaces think cred repository or

276
00:13:41.759 --> 00:13:43.480
<v Speaker 2>paging and sorting repository.

277
00:13:43.559 --> 00:13:44.799
<v Speaker 1>So I just define an interface.

278
00:13:44.919 --> 00:13:47.919
<v Speaker 2>You define an interface that extends one of those, and bam,

279
00:13:48.120 --> 00:13:51.120
<v Speaker 2>you instantly get standard methods like save fine by I,

280
00:13:51.279 --> 00:13:53.279
<v Speaker 2>find old, delete biog implemented for.

281
00:13:53.279 --> 00:13:55.200
<v Speaker 1>You without writing any SQL often.

282
00:13:55.399 --> 00:13:59.039
<v Speaker 2>Yes, it uses query derivation based on method names. If

283
00:13:59.080 --> 00:14:02.440
<v Speaker 2>you name a method find by email string email, spring

284
00:14:02.519 --> 00:14:05.120
<v Speaker 2>data figures out the query. It's pretty magical.

285
00:14:05.200 --> 00:14:07.360
<v Speaker 1>That is a huge time saver. Okay, so what about

286
00:14:07.440 --> 00:14:10.480
<v Speaker 1>the specific implementations like Spring data JDBC.

287
00:14:10.759 --> 00:14:13.600
<v Speaker 2>Spring Data JDBC gives you enhanced support on top of

288
00:14:13.639 --> 00:14:17.279
<v Speaker 2>plane JDBC. It's built around the aggregate root concept from

289
00:14:17.320 --> 00:14:20.240
<v Speaker 2>Domain driven Design Aggregate root. Yeah, it helps you model

290
00:14:20.240 --> 00:14:24.080
<v Speaker 2>your data relationships cleanly, ensuring consistency, especially when you have

291
00:14:24.159 --> 00:14:27.799
<v Speaker 2>complex optic graphs. It uses things like aggregate reference to

292
00:14:27.879 --> 00:14:29.320
<v Speaker 2>manage links between entities.

293
00:14:29.399 --> 00:14:32.200
<v Speaker 1>Okay, and the really popular one, Spring and Data JPA.

294
00:14:32.360 --> 00:14:35.919
<v Speaker 2>Right. JPA simplifies using the jag of Persistence API, boot,

295
00:14:35.879 --> 00:14:39.799
<v Speaker 2>auto Computers, a data source platform, Transaction Manager, NAT Manager,

296
00:14:39.799 --> 00:14:42.639
<v Speaker 2>factory all the JPA infrastructure.

297
00:14:42.120 --> 00:14:44.919
<v Speaker 1>And I just use annotations on my classes exactly at

298
00:14:45.120 --> 00:14:48.159
<v Speaker 1>entity to market class at ID for the primary key,

299
00:14:48.200 --> 00:14:51.679
<v Speaker 1>at generated value for generated IDs, at many, tone, at

300
00:14:51.679 --> 00:14:54.840
<v Speaker 1>many tominy for relationships. And it can create the tables too, Right,

301
00:14:54.960 --> 00:14:57.399
<v Speaker 1>I don't need schema dot A scale anymore often.

302
00:14:57.480 --> 00:15:01.360
<v Speaker 2>Yes, JPA providers like Hibernate can generate the DDL Data

303
00:15:01.360 --> 00:15:04.840
<v Speaker 2>Definition Language to create or update your schema based on

304
00:15:04.879 --> 00:15:08.279
<v Speaker 2>your entity definitions when the app starts. Another big simplification.

305
00:15:08.600 --> 00:15:12.159
<v Speaker 1>Wow. Okay, so that's data access covered. But what if

306
00:15:12.159 --> 00:15:14.480
<v Speaker 1>I want to expose this data as a rest API

307
00:15:14.639 --> 00:15:17.639
<v Speaker 1>without writing any controllers myself? Is that possible?

308
00:15:17.720 --> 00:15:20.159
<v Speaker 2>It absolutely is. That's where Spring Data rest comes in.

309
00:15:20.360 --> 00:15:21.000
<v Speaker 2>It's amazing.

310
00:15:21.080 --> 00:15:21.559
<v Speaker 1>What does it do.

311
00:15:21.720 --> 00:15:25.559
<v Speaker 2>It automatically builds a hyper media driven rest API directly

312
00:15:25.559 --> 00:15:29.639
<v Speaker 2>from your Spring Data repository interfaces. Just add the dependency seriously,

313
00:15:29.759 --> 00:15:32.559
<v Speaker 2>just like that, pretty much. Add the Spring Data restel

314
00:15:32.600 --> 00:15:36.080
<v Speaker 2>explorer starter and you instantly get a discoverable API explore

315
00:15:36.120 --> 00:15:39.080
<v Speaker 2>at http dot localhost dot a zero ad R. You

316
00:15:39.080 --> 00:15:42.120
<v Speaker 2>can browse your resources, see the endpoints. It's incredible for

317
00:15:42.200 --> 00:15:43.519
<v Speaker 2>rapid API prototyping.

318
00:15:43.679 --> 00:15:46.720
<v Speaker 1>An API explorer pops up automatically. That's fantastic.

319
00:15:46.879 --> 00:15:49.840
<v Speaker 2>Yeah, and you can customize the endpoint paths, the names

320
00:15:49.919 --> 00:15:53.200
<v Speaker 2>used for resources, and so on using the at repository

321
00:15:53.240 --> 00:15:56.399
<v Speaker 2>rest resource annotation if the defaults aren't perfect.

322
00:15:56.559 --> 00:16:00.919
<v Speaker 1>Okay, that's seriously powerful. Now, what about new SQL databases

323
00:16:01.000 --> 00:16:05.120
<v Speaker 1>like Mango dB or reddis is integration just as smooth.

324
00:16:05.080 --> 00:16:08.840
<v Speaker 2>Pretty much. Yeah. For Mango dB adds Spring Bootstarter data.

325
00:16:08.919 --> 00:16:12.879
<v Speaker 2>Mangun boot auto configures the connection you typically interact using

326
00:16:13.120 --> 00:16:14.679
<v Speaker 2>Mango template or Mongo.

327
00:16:14.399 --> 00:16:16.759
<v Speaker 1>Operations anything specific to now like with Docker.

328
00:16:16.919 --> 00:16:18.840
<v Speaker 2>Yeah, if you're using doctor composed, make sure to set

329
00:16:18.879 --> 00:16:21.759
<v Speaker 2>the Mango endb database environment variable so it knows which

330
00:16:21.799 --> 00:16:25.080
<v Speaker 2>database to initialize. Oh, in Spring data, Mango dB adds

331
00:16:25.080 --> 00:16:27.320
<v Speaker 2>a class field to your documents to help with mapping

332
00:16:27.360 --> 00:16:28.559
<v Speaker 2>back to Java objects.

333
00:16:28.639 --> 00:16:32.000
<v Speaker 1>Okay, and reddis for cashing or key value stuff.

334
00:16:32.080 --> 00:16:35.399
<v Speaker 2>Similar story, add Spring Bootstarter data reddis. You can map

335
00:16:35.440 --> 00:16:38.000
<v Speaker 2>your Java objects to Rettis hashes using the at rettis

336
00:16:38.000 --> 00:16:41.240
<v Speaker 2>hash annotation. It stores data with clear keys like retroboard

337
00:16:41.240 --> 00:16:44.879
<v Speaker 2>for the type and retroboard dot ued for specific instances.

338
00:16:45.120 --> 00:16:49.039
<v Speaker 1>So SQL or nosea boot really smooths out the setup

339
00:16:49.080 --> 00:16:53.639
<v Speaker 1>and basic operations. Okay, let's switch paradigms completely reactive programming.

340
00:16:54.000 --> 00:16:57.200
<v Speaker 1>The book mentions the Reactive Manifesto. What's the core idea there?

341
00:16:57.279 --> 00:17:00.960
<v Speaker 2>The Reactive Manifesto back from twenty fourteen lays out the

342
00:17:01.000 --> 00:17:04.680
<v Speaker 2>traits of reactive systems. They need to be responsive, resilient,

343
00:17:04.960 --> 00:17:06.960
<v Speaker 2>elastic and message driven.

344
00:17:06.839 --> 00:17:11.240
<v Speaker 1>So quick, fault tolerant, scalable and using async messages exactly.

345
00:17:11.359 --> 00:17:14.720
<v Speaker 2>It's about building systems that handle load and failure gracefully.

346
00:17:15.279 --> 00:17:18.920
<v Speaker 2>Using asynchronous communication and back pressure is key so components

347
00:17:18.920 --> 00:17:21.720
<v Speaker 2>don't get overwhelmed. It's a different way of thinking compared

348
00:17:21.720 --> 00:17:23.440
<v Speaker 2>to traditional blocking code.

349
00:17:23.200 --> 00:17:26.039
<v Speaker 1>A big shift. And how does Spring implement this on

350
00:17:26.079 --> 00:17:26.640
<v Speaker 1>the JVM?

351
00:17:26.839 --> 00:17:29.480
<v Speaker 2>Primarily through Project Reactor. It's a library based on the

352
00:17:29.559 --> 00:17:32.960
<v Speaker 2>reactive stream specification that's a standard for ACYNC stream processing

353
00:17:33.000 --> 00:17:36.920
<v Speaker 2>with back pressure. Reactor brings this non blocking, event driven

354
00:17:36.960 --> 00:17:38.119
<v Speaker 2>approach to Java.

355
00:17:38.160 --> 00:17:40.920
<v Speaker 1>And what are the main building blocks developers use in reactor?

356
00:17:41.039 --> 00:17:43.400
<v Speaker 2>The two core types are monot and flux.

357
00:17:43.160 --> 00:17:45.000
<v Speaker 1>T Mono andflux okay.

358
00:17:45.279 --> 00:17:48.519
<v Speaker 2>Mono represents the stream of zero or one item. Think

359
00:17:48.559 --> 00:17:51.960
<v Speaker 2>of it like an ACNC optional. Flux represents the stream

360
00:17:52.079 --> 00:17:54.960
<v Speaker 2>of zero to n items. It's an asynchronous sequence.

361
00:17:55.039 --> 00:17:57.960
<v Speaker 1>Got it? And when you use this with springboot, how

362
00:17:57.960 --> 00:18:00.000
<v Speaker 1>do you reactive web and data look different.

363
00:18:00.440 --> 00:18:04.480
<v Speaker 2>For reactive web you add spring boots Starter web flux boot,

364
00:18:04.519 --> 00:18:08.519
<v Speaker 2>autoconfigures it, and crucially it defaults to using Netty instead

365
00:18:08.519 --> 00:18:09.680
<v Speaker 2>of Tomcat as the server.

366
00:18:09.799 --> 00:18:11.519
<v Speaker 1>Because netti is non blocking.

367
00:18:11.240 --> 00:18:15.119
<v Speaker 2>Exactly ensures the whole iostack is non blocking. For reactive

368
00:18:15.160 --> 00:18:20.359
<v Speaker 2>data access, you'd use reactive repository interfaces like reactive CRUD repository, so.

369
00:18:20.359 --> 00:18:23.279
<v Speaker 1>The entire request path from web to database and back

370
00:18:23.359 --> 00:18:24.440
<v Speaker 1>can be non blocking.

371
00:18:24.559 --> 00:18:27.720
<v Speaker 2>That's the goal. It's essential for applications needing really high

372
00:18:27.720 --> 00:18:29.400
<v Speaker 2>concurrency and low latency.

373
00:18:29.480 --> 00:18:33.200
<v Speaker 1>Okay, a powerful option for specific needs. Now let's talk

374
00:18:33.200 --> 00:18:37.480
<v Speaker 1>about communication within and between applications using messaging. How does

375
00:18:37.519 --> 00:18:38.960
<v Speaker 1>spring boot handle events?

376
00:18:39.319 --> 00:18:42.200
<v Speaker 2>Well, Spring itself has core events like context refreshed event.

377
00:18:42.440 --> 00:18:44.920
<v Speaker 2>Spring boot adds its own like application ready event. We

378
00:18:44.960 --> 00:18:47.640
<v Speaker 2>mentioned that one earlier fires when the app is fully ready.

379
00:18:47.720 --> 00:18:50.400
<v Speaker 1>Can I create my own events for internal communication like

380
00:18:50.480 --> 00:18:51.920
<v Speaker 1>decoupling parts of my app?

381
00:18:52.119 --> 00:18:55.000
<v Speaker 2>Oh? Absolutely, it's a great pattern. You can create custom

382
00:18:55.039 --> 00:18:59.039
<v Speaker 2>event classes by extending application event or even simpler, just

383
00:18:59.279 --> 00:19:01.559
<v Speaker 2>anne tape method with at event listener.

384
00:19:01.640 --> 00:19:04.559
<v Speaker 1>So I could have say a user activated event.

385
00:19:04.400 --> 00:19:07.039
<v Speaker 2>Exactly publish that event when a user becomes active. Then

386
00:19:07.079 --> 00:19:09.880
<v Speaker 2>have another component listen for at event listener and if

387
00:19:09.880 --> 00:19:11.960
<v Speaker 2>you want the listener to run without blocking the publisher,

388
00:19:12.200 --> 00:19:15.279
<v Speaker 2>just add at at ASNC. Really powerful for loose coupling.

389
00:19:15.599 --> 00:19:19.759
<v Speaker 1>Nice. What about more traditional messaging systems JMS.

390
00:19:19.319 --> 00:19:22.880
<v Speaker 2>Easy integration, add the starter for active MQ Spring Bootstarter,

391
00:19:23.000 --> 00:19:25.920
<v Speaker 2>Active MQ or Artemis Spring bootstarter.

392
00:19:25.640 --> 00:19:27.759
<v Speaker 1>Artemis and sending and receiving.

393
00:19:27.599 --> 00:19:30.799
<v Speaker 2>You use JMS template dot convert and send to publish messages.

394
00:19:31.160 --> 00:19:33.839
<v Speaker 2>To listen, you just annotate a method with at JMS

395
00:19:33.839 --> 00:19:36.440
<v Speaker 2>listener specifying the Q or topic.

396
00:19:36.240 --> 00:19:38.640
<v Speaker 1>Name and pubsub versus point to point.

397
00:19:38.599 --> 00:19:42.599
<v Speaker 2>Simple property dot spring dot JMS dot pubsubdomain true switches

398
00:19:42.640 --> 00:19:44.839
<v Speaker 2>it to topic mode published subscribe.

399
00:19:45.039 --> 00:19:48.119
<v Speaker 1>Okay, straightforward. What about AMQP and RabbitMQ that has more

400
00:19:48.119 --> 00:19:50.599
<v Speaker 1>complex concepts right exchanges, bindings it.

401
00:19:50.599 --> 00:19:55.440
<v Speaker 2>Does MQP uses exchanges, bindings and queues. Messages go to

402
00:19:55.480 --> 00:19:58.799
<v Speaker 2>an exchange first. Bindings are rules that wrote messages from

403
00:19:58.839 --> 00:20:02.160
<v Speaker 2>an exchange to specific queues. Queues are where consumers pick

404
00:20:02.160 --> 00:20:02.799
<v Speaker 2>messages up.

405
00:20:03.079 --> 00:20:05.599
<v Speaker 1>So the exchanges like the central post office, bindings are

406
00:20:05.599 --> 00:20:07.839
<v Speaker 1>the sorting rules. Queues are the mailboxes.

407
00:20:07.920 --> 00:20:11.440
<v Speaker 2>Perfect analogy, and there are different types of exchanges for

408
00:20:11.480 --> 00:20:15.599
<v Speaker 2>different routing logic direct uses a specific routing key, fan

409
00:20:15.680 --> 00:20:20.200
<v Speaker 2>out broadcast to all bound cues. Topic uses wildcard routing

410
00:20:20.279 --> 00:20:24.440
<v Speaker 2>keys like user or audit hashtag headers roots based on

411
00:20:24.440 --> 00:20:25.200
<v Speaker 2>message headers.

412
00:20:25.359 --> 00:20:28.880
<v Speaker 1>Lots of flexibility there. How to spring AMQP help.

413
00:20:29.079 --> 00:20:31.960
<v Speaker 2>It gives you annotations like at rabbit listener to easily

414
00:20:31.960 --> 00:20:35.960
<v Speaker 2>consume messages, and you can programmatically declare queues, exchanges and

415
00:20:36.000 --> 00:20:40.480
<v Speaker 2>bindings using at qu at exchange and at que binding annotations,

416
00:20:40.559 --> 00:20:42.079
<v Speaker 2>which simplifies set up a lot.

417
00:20:42.240 --> 00:20:45.480
<v Speaker 1>Okay, powerful routing options. What about real time two way

418
00:20:45.480 --> 00:20:48.440
<v Speaker 1>communication like for chat apps or live dashboards?

419
00:20:48.480 --> 00:20:51.079
<v Speaker 2>For that, you typically use web sockets. It's a protocol

420
00:20:51.119 --> 00:20:55.200
<v Speaker 2>providing full duplex communication over a single TCP connection. Client

421
00:20:55.240 --> 00:20:57.599
<v Speaker 2>and server can both send messages anytime, and.

422
00:20:57.559 --> 00:20:59.880
<v Speaker 1>People often use STOMP over web sockets.

423
00:21:00.200 --> 00:21:04.200
<v Speaker 2>Yes. STOMP simple text oriented messaging protocol adds a layer

424
00:21:04.200 --> 00:21:08.559
<v Speaker 2>on top providing message headers, destinations, and a pub submodel,

425
00:21:08.799 --> 00:21:11.599
<v Speaker 2>making it easier to route messages to specific users or

426
00:21:11.599 --> 00:21:13.480
<v Speaker 2>topics within the web socket connection.

427
00:21:13.559 --> 00:21:14.839
<v Speaker 1>How do you set that up? In boot?

428
00:21:15.240 --> 00:21:18.839
<v Speaker 2>Add Spring Bootstarter web socket UH on the server you

429
00:21:19.000 --> 00:21:22.440
<v Speaker 2>use at enable web socket message broker and configure endpoints

430
00:21:22.480 --> 00:21:26.039
<v Speaker 2>and brokers using web socket message broker configure.

431
00:21:25.839 --> 00:21:28.480
<v Speaker 1>And the book also mentions our socket what's that for?

432
00:21:28.880 --> 00:21:32.400
<v Speaker 2>Our socket is a newer binary protocol designed for high performance,

433
00:21:32.440 --> 00:21:35.680
<v Speaker 2>low latency communication, especially between micro services.

434
00:21:35.839 --> 00:21:37.880
<v Speaker 1>Binary not tech space.

435
00:21:37.680 --> 00:21:41.079
<v Speaker 2>Right, and it supports more interaction models than just request response.

436
00:21:41.319 --> 00:21:44.680
<v Speaker 2>You have fire and forget request stream, server streams, data

437
00:21:44.759 --> 00:21:47.559
<v Speaker 2>back and channel fully bi directional streams.

438
00:21:47.599 --> 00:21:49.359
<v Speaker 1>How do you use it with springboot ad.

439
00:21:49.279 --> 00:21:52.319
<v Speaker 2>Spring bootstarter socket? You use our socket request or on

440
00:21:52.359 --> 00:21:54.400
<v Speaker 2>the client side and at message mapping on the server

441
00:21:54.480 --> 00:21:58.359
<v Speaker 2>side to handle incoming requests or streams. It's geared towards

442
00:21:58.400 --> 00:21:59.559
<v Speaker 2>high throughput scenarios.

443
00:21:59.799 --> 00:22:03.440
<v Speaker 1>Okay, so boot really covers the whole spectrum of communication needs.

444
00:22:03.799 --> 00:22:07.359
<v Speaker 1>Now let's talk about getting these apps production ready spring Boot.

445
00:22:07.400 --> 00:22:11.200
<v Speaker 1>Actuator is key here right for observability.

446
00:22:10.440 --> 00:22:14.240
<v Speaker 2>Absolutely, Actuator is your go to for production insights. Yeah.

447
00:22:14.279 --> 00:22:17.119
<v Speaker 2>It exposes a ton of useful information and management endpoints

448
00:22:17.119 --> 00:22:21.799
<v Speaker 2>over HTTP or JMX, think metrics, health checks, environment variables,

449
00:22:22.240 --> 00:22:24.279
<v Speaker 2>thread dumps, logger levels.

450
00:22:24.039 --> 00:22:27.519
<v Speaker 1>Like a built in dashboard for your apps internals kind of.

451
00:22:27.640 --> 00:22:29.920
<v Speaker 2>Yeah. It gives monitoring tools the hooks they need.

452
00:22:30.119 --> 00:22:31.640
<v Speaker 1>What are the most critical endpoints?

453
00:22:31.720 --> 00:22:35.000
<v Speaker 2>The main prefix is actuator. The most important one enabled

454
00:22:35.000 --> 00:22:37.960
<v Speaker 2>by default is actuator Health. It gives a basic updown

455
00:22:37.960 --> 00:22:41.640
<v Speaker 2>status but can be customized to check dependencies too and others.

456
00:22:41.880 --> 00:22:45.480
<v Speaker 2>Actuator info for app info, Actuator Metrics for detailed metrics,

457
00:22:45.759 --> 00:22:48.559
<v Speaker 2>Actuator loggers to view and change log levels on the fly,

458
00:22:49.119 --> 00:22:52.400
<v Speaker 2>Actuator beans to see all the Spring beans, Actuator events

459
00:22:52.400 --> 00:22:56.559
<v Speaker 2>for environment properties, Actuator audit events for security stuff. Lots

460
00:22:56.559 --> 00:22:57.160
<v Speaker 2>of useful ones?

461
00:22:57.200 --> 00:22:59.759
<v Speaker 1>Are they all enabled by default? Seems like some could be?

462
00:22:59.759 --> 00:23:03.640
<v Speaker 2>Some good point? No, Only health and sometimes info are

463
00:23:03.640 --> 00:23:07.559
<v Speaker 2>exposed over HTTP by default. You need to explicitly enable

464
00:23:07.599 --> 00:23:11.720
<v Speaker 2>others using the management Dot endpoints dot web dot exposure DOT.

465
00:23:11.519 --> 00:23:16.400
<v Speaker 3>Include property like health infometrics exactly, and for sensited ones

466
00:23:16.440 --> 00:23:20.640
<v Speaker 3>like loggers or envy, you absolutely must secure them, usually

467
00:23:20.680 --> 00:23:23.960
<v Speaker 3>by integrating Actuator with Spring security and requiring a specific

468
00:23:24.039 --> 00:23:26.519
<v Speaker 3>role like actuator admin makes sense.

469
00:23:26.599 --> 00:23:30.359
<v Speaker 1>Can I create my own Actuator endpoints for application specific stuff?

470
00:23:30.440 --> 00:23:33.480
<v Speaker 2>Yep, It's surprisingly easy. You create a class annotated with

471
00:23:33.599 --> 00:23:37.000
<v Speaker 2>that endpoint, and then methods inside annotated with that readoperation

472
00:23:37.200 --> 00:23:40.720
<v Speaker 2>for deed, at write operation for PSD or at delete

473
00:23:40.759 --> 00:23:43.759
<v Speaker 2>operation lets you expose custom state or operations.

474
00:23:43.920 --> 00:23:47.200
<v Speaker 1>What about custom health checks, like checking if a downstream

475
00:23:47.240 --> 00:23:48.119
<v Speaker 1>service is reachable?

476
00:23:48.119 --> 00:23:51.319
<v Speaker 2>Definitely you implement the health Indicator interface. This lets you

477
00:23:51.319 --> 00:23:54.319
<v Speaker 2>plug in custom logic, check a database, call an external API,

478
00:23:54.920 --> 00:23:57.440
<v Speaker 2>verify a business rule, and have its status contribute to

479
00:23:57.480 --> 00:24:01.079
<v Speaker 2>the overall Actuator health endpoint a much riger picture of health.

480
00:24:01.200 --> 00:24:05.119
<v Speaker 1>Okay, and for the full observability trifecta metrics, logs tracing.

481
00:24:05.160 --> 00:24:06.279
<v Speaker 1>How does actuator fit in?

482
00:24:06.640 --> 00:24:10.279
<v Speaker 2>Actuator is the main integration point, especially for metrics. It

483
00:24:10.400 --> 00:24:14.160
<v Speaker 2>uses micrometer underneath micrometer. Yeah, it's a vendor neutral application

484
00:24:14.240 --> 00:24:18.960
<v Speaker 2>metrics facade think SLF four J. But for metrics, Actuator

485
00:24:19.039 --> 00:24:20.559
<v Speaker 2>exposes micrometer metrics.

486
00:24:20.559 --> 00:24:22.640
<v Speaker 1>Can I add my own business metrics easily?

487
00:24:22.839 --> 00:24:26.440
<v Speaker 2>Yes? You can inject the meter registry and create counters, timers,

488
00:24:26.519 --> 00:24:30.359
<v Speaker 2>gauges directly, or even better, use the ad observed annotation

489
00:24:30.440 --> 00:24:35.039
<v Speaker 2>from Micrometer Observation AOP for a more declarative approach. You

490
00:24:35.079 --> 00:24:38.000
<v Speaker 2>can also use things like handler interceptor to automatically time

491
00:24:38.319 --> 00:24:39.200
<v Speaker 2>web requests.

492
00:24:39.480 --> 00:24:42.839
<v Speaker 1>Okay, So metrics are covered. What about logs and distributed tracing?

493
00:24:43.160 --> 00:24:45.599
<v Speaker 2>For logs, you typically can figure something like log back

494
00:24:45.720 --> 00:24:50.359
<v Speaker 2>using logbackspring dot xml to output structured logs like JSON

495
00:24:50.720 --> 00:24:53.079
<v Speaker 2>and then ship them off to a log aggregation system

496
00:24:53.119 --> 00:24:55.400
<v Speaker 2>like Grafonoloki or elastic search.

497
00:24:55.240 --> 00:24:57.119
<v Speaker 1>And tracing across micro services.

498
00:24:57.279 --> 00:25:01.160
<v Speaker 2>For that you integrate with distributed tracing systems. Spring Boot

499
00:25:01.240 --> 00:25:04.000
<v Speaker 2>has great support for Jaeger and Zipkin, often visualized with

500
00:25:04.079 --> 00:25:08.119
<v Speaker 2>Graffana Tempo. My Chrometer Tracing handles the instrumentation.

501
00:25:07.880 --> 00:25:09.839
<v Speaker 1>And Graffana brings it all together exactly.

502
00:25:10.440 --> 00:25:14.920
<v Speaker 2>Use Prometheus often to scrape the actuated Prometheus metrics endpoint

503
00:25:15.279 --> 00:25:18.359
<v Speaker 2>looking for logs, Tempo for traces, and then Graffana provides

504
00:25:18.400 --> 00:25:22.599
<v Speaker 2>the unified dashboards to visualize everything. That's your full observability stack.

505
00:25:22.759 --> 00:25:26.960
<v Speaker 1>That's a comprehensive setup. Okay, ensuring quality before production testing.

506
00:25:27.119 --> 00:25:28.880
<v Speaker 1>How does springboot help there?

507
00:25:29.079 --> 00:25:31.720
<v Speaker 2>It builds on the standard spring test framework but adds

508
00:25:31.720 --> 00:25:36.319
<v Speaker 2>autoconfiguration goodness. The main tool for integration testing is at springboot.

509
00:25:35.839 --> 00:25:38.240
<v Speaker 1>Test and that loads the whole application context.

510
00:25:38.279 --> 00:25:40.720
<v Speaker 2>Yes, it loads the full context, making it very realistic.

511
00:25:41.000 --> 00:25:44.680
<v Speaker 2>You can control the web environment, random port, moc numbi,

512
00:25:45.319 --> 00:25:49.200
<v Speaker 2>past properties ARGs. It's flexible but can be slower.

513
00:25:49.319 --> 00:25:51.720
<v Speaker 1>Right, loading everything can be slow. What if I just

514
00:25:51.759 --> 00:25:53.680
<v Speaker 1>want to test one layer like my web controllers.

515
00:25:53.720 --> 00:25:55.960
<v Speaker 2>That's where test likeses are brilliant. They load only the

516
00:25:56.000 --> 00:25:58.440
<v Speaker 2>parts of the context relevant to a specific layer, making

517
00:25:58.519 --> 00:26:01.960
<v Speaker 2>tests much faster. Example, at webmvictest is a big one.

518
00:26:02.039 --> 00:26:04.599
<v Speaker 2>It focuses just on the web layer, your controllers, filters,

519
00:26:04.599 --> 00:26:07.440
<v Speaker 2>et cetera. It auto configures mock them VC for sending

520
00:26:07.480 --> 00:26:11.119
<v Speaker 2>mock HTTP requests and often uses at mockbeing to mock

521
00:26:11.160 --> 00:26:12.960
<v Speaker 2>out service dependencies.

522
00:26:12.599 --> 00:26:15.559
<v Speaker 1>So you test the controller in isolation pretty much.

523
00:26:15.960 --> 00:26:20.119
<v Speaker 2>There's also at json test for testing Jason serial de

524
00:26:20.240 --> 00:26:21.599
<v Speaker 2>serialization logic.

525
00:26:21.359 --> 00:26:24.400
<v Speaker 1>Specifically, and for the data layer testing repositories.

526
00:26:24.519 --> 00:26:27.799
<v Speaker 2>You have slices like at data JPay tests for jpa

527
00:26:28.000 --> 00:26:30.720
<v Speaker 2>at data, Mango tests for manga deb at data edis

528
00:26:30.759 --> 00:26:34.480
<v Speaker 2>test at jdbt tests. These load just a data configuration

529
00:26:34.680 --> 00:26:37.920
<v Speaker 2>and often use an embedded database or mock the noseql client.

530
00:26:38.160 --> 00:26:41.359
<v Speaker 1>But embedded databases aren't always the same as production. How

531
00:26:41.359 --> 00:26:44.960
<v Speaker 1>do you test against a real database like postgress bowl reliably?

532
00:26:45.279 --> 00:26:47.759
<v Speaker 2>That's the perfect use case for test containers. It's fantastic

533
00:26:47.839 --> 00:26:50.000
<v Speaker 2>that does it work. You annotate your test class to

534
00:26:50.079 --> 00:26:52.240
<v Speaker 2>use a container like a container for a post riscal

535
00:26:52.319 --> 00:26:56.079
<v Speaker 2>container test container starts a real postgressfol instance in Docker

536
00:26:56.599 --> 00:26:57.440
<v Speaker 2>just for your test run.

537
00:26:57.720 --> 00:26:59.960
<v Speaker 1>Wow, a real database instance.

538
00:26:59.599 --> 00:27:02.640
<v Speaker 2>For tests yep, and with at service connection, spring Boot

539
00:27:02.680 --> 00:27:05.799
<v Speaker 2>tests can automatically configure your application context to connect to

540
00:27:05.839 --> 00:27:10.079
<v Speaker 2>that container. It makes integration tests incredibly reliable. The at

541
00:27:10.119 --> 00:27:13.200
<v Speaker 2>restart scope annotation is also useful to keep the container

542
00:27:13.279 --> 00:27:16.440
<v Speaker 2>running between test methods in the same class, speeding things up.

543
00:27:16.599 --> 00:27:22.160
<v Speaker 1>That's amazing for confidence, okay, equally critical security. How does

544
00:27:22.400 --> 00:27:24.279
<v Speaker 1>spring boot security work under the hood.

545
00:27:24.400 --> 00:27:27.279
<v Speaker 2>It's built around a chain of servelet filters. The entry

546
00:27:27.279 --> 00:27:30.720
<v Speaker 2>point is usually delegating filter proxy, which passes the request

547
00:27:30.720 --> 00:27:34.920
<v Speaker 2>to a filterchain proxy. This proxy manages multiple security filter

548
00:27:35.039 --> 00:27:39.720
<v Speaker 2>chain instances, each potentially handling different URL patterns or security concerns.

549
00:27:40.359 --> 00:27:45.000
<v Speaker 2>It processes the HTTP servelet request and HTTP servelet response.

550
00:27:45.079 --> 00:27:46.359
<v Speaker 1>How do I add it to my project?

551
00:27:46.519 --> 00:27:50.799
<v Speaker 2>Just add the spring boot starter security dependency. Springboot autoconfigures

552
00:27:50.839 --> 00:27:54.720
<v Speaker 2>basic security immediately, which means usually it enables HTTP basic

553
00:27:54.720 --> 00:27:57.599
<v Speaker 2>informed log in, secures all end points by default, and

554
00:27:57.680 --> 00:28:00.319
<v Speaker 2>generates a default user with a random password into the

555
00:28:00.319 --> 00:28:02.839
<v Speaker 2>console and startup just enough to get you started securely.

556
00:28:02.920 --> 00:28:05.480
<v Speaker 1>How do I manage users properly, not just the default

557
00:28:05.480 --> 00:28:06.319
<v Speaker 1>and memory one.

558
00:28:06.599 --> 00:28:09.599
<v Speaker 2>For simple cases, you can configure in memory user details manager,

559
00:28:09.920 --> 00:28:12.880
<v Speaker 2>but for real apps you implement the user detail service.

560
00:28:12.640 --> 00:28:14.440
<v Speaker 1>Interface and that talks to my database.

561
00:28:14.759 --> 00:28:18.200
<v Speaker 2>Typically, yes, you'd inject your user repository into your custom

562
00:28:18.279 --> 00:28:22.799
<v Speaker 2>user detail service implementation to load user details. Spring security

563
00:28:22.799 --> 00:28:26.200
<v Speaker 2>then uses a DEO authentication provider to check passwords against

564
00:28:26.200 --> 00:28:27.079
<v Speaker 2>what your service.

565
00:28:26.759 --> 00:28:30.240
<v Speaker 1>Returns, and you configure log in methods like form log in.

566
00:28:30.400 --> 00:28:33.920
<v Speaker 2>Yeah. Using the HTDP security Configuration object, you call methods

567
00:28:33.960 --> 00:28:37.640
<v Speaker 2>like HTTP basic or form log in to enable those mechanisms.

568
00:28:38.240 --> 00:28:42.519
<v Speaker 2>You also configure authorization rules there, like request matchers, admin

569
00:28:42.599 --> 00:28:44.640
<v Speaker 2>dot has role adm an.

570
00:28:45.079 --> 00:28:46.960
<v Speaker 1>What about cores? That's always tricky.

571
00:28:47.000 --> 00:28:50.160
<v Speaker 2>With front ends trucial, you can figure cores using a

572
00:28:50.200 --> 00:28:53.960
<v Speaker 2>course configuration source being usually within your security configuration to

573
00:28:54.039 --> 00:28:55.640
<v Speaker 2>allow requests from your front ends.

574
00:28:55.440 --> 00:28:57.000
<v Speaker 1>Origin and reactive security.

575
00:28:57.240 --> 00:29:00.640
<v Speaker 2>For web flex it's similar conceptually, but uses re active types.

576
00:29:00.799 --> 00:29:03.799
<v Speaker 2>You can figure server HTTP security instead of HTTP security,

577
00:29:04.079 --> 00:29:07.200
<v Speaker 2>and things like login handlers use reactive interfaces like server

578
00:29:07.240 --> 00:29:08.680
<v Speaker 2>authentication success handler.

579
00:29:08.759 --> 00:29:11.319
<v Speaker 1>Can I test security rules easily without doing a full

580
00:29:11.359 --> 00:29:12.359
<v Speaker 1>log in and every test?

581
00:29:12.759 --> 00:29:16.160
<v Speaker 2>Yes. The atwith mock user annotation is perfect for this.

582
00:29:16.480 --> 00:29:19.480
<v Speaker 2>You can apply it to your at webmvictest or at webflux.

583
00:29:19.519 --> 00:29:22.400
<v Speaker 2>Test methods to simulate a request coming from an already

584
00:29:22.440 --> 00:29:25.799
<v Speaker 2>authenticated user with specific roles saves a ton of setup.

585
00:29:26.039 --> 00:29:30.119
<v Speaker 1>Very handy. What about social login OOF two with GitHub.

586
00:29:29.799 --> 00:29:34.079
<v Speaker 2>Or Google also well supported? Add Spring Bootstarter O two client.

587
00:29:34.279 --> 00:29:36.799
<v Speaker 2>You can figure your client ID in secret from the provider,

588
00:29:37.079 --> 00:29:40.279
<v Speaker 2>use environment variables or secrets management, never hardcode them. Spring

589
00:29:40.319 --> 00:29:43.680
<v Speaker 2>Security handles the whole redirect dance and authentication flow smooth.

590
00:29:44.039 --> 00:29:47.000
<v Speaker 1>The book also mentions Spring Authorization Server. What's that? Why

591
00:29:47.039 --> 00:29:48.759
<v Speaker 1>would I run my own authorization server?

592
00:29:48.839 --> 00:29:50.680
<v Speaker 2>That's for when you want to be the identity provider,

593
00:29:50.839 --> 00:29:53.759
<v Speaker 2>maybe for your own suite of micro services or partner applications.

594
00:29:54.319 --> 00:29:58.359
<v Speaker 2>Spring Authorization Server is a dedicated project providing a compliant

595
00:29:58.359 --> 00:30:02.000
<v Speaker 2>OOF two point one and open id Connect one point

596
00:30:02.079 --> 00:30:05.839
<v Speaker 2>zero server implementation built on Spring Security. You can figure

597
00:30:05.839 --> 00:30:10.119
<v Speaker 2>clients scopes like users, dot red, token, settings, etc. Gives

598
00:30:10.119 --> 00:30:12.119
<v Speaker 2>you full control over the identity aspect.

599
00:30:12.240 --> 00:30:15.880
<v Speaker 1>Okay, so full spectrum of security. Let's shift to performance

600
00:30:15.920 --> 00:30:20.200
<v Speaker 1>and deployment Spring boot native and AOT with galvim. What's

601
00:30:20.240 --> 00:30:21.480
<v Speaker 1>the big deal with GraalVM.

602
00:30:21.599 --> 00:30:25.920
<v Speaker 2>Galvm is a high performance JDK distribution key features are

603
00:30:26.279 --> 00:30:31.160
<v Speaker 2>faster JIT compilation, support for multiple languages, and most importantly

604
00:30:31.200 --> 00:30:34.279
<v Speaker 2>for this discussion, its native image capability.

605
00:30:34.839 --> 00:30:37.400
<v Speaker 1>Native image What does that actually mean for my app?

606
00:30:37.720 --> 00:30:40.240
<v Speaker 2>It means compiling your Java Cottlin code ahead of time

607
00:30:40.359 --> 00:30:44.640
<v Speaker 2>AOT into a standalone native executable for a specific platform

608
00:30:44.680 --> 00:30:48.119
<v Speaker 2>like Linux by sixty four. This executable does not require

609
00:30:48.119 --> 00:30:49.039
<v Speaker 2>a JVM to run.

610
00:30:49.119 --> 00:30:50.599
<v Speaker 1>No JVM. What's the benefit?

611
00:30:50.880 --> 00:30:55.720
<v Speaker 2>Huge benefits. Drastically faster startup times think milliseconds instead of seconds,

612
00:30:55.799 --> 00:30:59.039
<v Speaker 2>and significantly lower memory footprint, maybe tens of megabytes instead

613
00:30:59.079 --> 00:31:02.240
<v Speaker 2>of hundreds. It's the game changer for serverless functions, containers

614
00:31:02.279 --> 00:31:04.240
<v Speaker 2>anywhere resources or startup speed matter.

615
00:31:04.440 --> 00:31:06.519
<v Speaker 1>That is a massive difference. How do you build one

616
00:31:06.519 --> 00:31:07.200
<v Speaker 1>with Springboot?

617
00:31:07.480 --> 00:31:10.480
<v Speaker 2>Typically using the build tool plugins like Doug gritlue Boot

618
00:31:10.480 --> 00:31:13.480
<v Speaker 2>build Image or the Maven equivalent. This often uses cloud

619
00:31:13.519 --> 00:31:15.920
<v Speaker 2>native build packs behind the scenes to perform the native

620
00:31:15.920 --> 00:31:18.559
<v Speaker 2>compilation inside a container and package the result.

621
00:31:18.920 --> 00:31:22.559
<v Speaker 1>And what spring boots specific role the AOT part exactly.

622
00:31:22.680 --> 00:31:26.240
<v Speaker 2>The standard Java reflection and dynamic proxies that spring uses

623
00:31:26.279 --> 00:31:30.759
<v Speaker 2>heavily are difficult for grailvm's static analysis, so spring boots

624
00:31:30.839 --> 00:31:34.799
<v Speaker 2>AOT engine runs at build time, analyzes your application context

625
00:31:35.079 --> 00:31:37.960
<v Speaker 2>figures out what beams, proxies and configurations will be needed

626
00:31:38.000 --> 00:31:41.119
<v Speaker 2>at runtime, and generates extra source code and hints.

627
00:31:41.559 --> 00:31:44.359
<v Speaker 1>So it pre computes the runtime configuration essentially.

628
00:31:44.400 --> 00:31:48.440
<v Speaker 2>Yes, it generates code that GRAILVM can analyze statically, allowing

629
00:31:48.440 --> 00:31:52.160
<v Speaker 2>the native compilation to succeed while preserving Springs functionality.

630
00:31:52.400 --> 00:31:55.960
<v Speaker 1>What if my code does something really dynamic, like reflection

631
00:31:56.079 --> 00:31:57.640
<v Speaker 1>that the AOT engine misses.

632
00:31:57.880 --> 00:32:00.960
<v Speaker 2>That's where you need runtime hints. Can implement a runtime

633
00:32:01.039 --> 00:32:04.880
<v Speaker 2>hints registrar interface to programmatically tell the AOT engine about

634
00:32:04.920 --> 00:32:10.200
<v Speaker 2>specific reflection needs, resource loading, serialization, or proxy requirements that

635
00:32:10.240 --> 00:32:11.599
<v Speaker 2>it couldn't detect automatically.

636
00:32:11.680 --> 00:32:14.799
<v Speaker 1>Okay, so native images offer huge performance games enabled by

637
00:32:14.799 --> 00:32:18.960
<v Speaker 1>Springs AOT processing. Now looming out to architecture spring Cloud

638
00:32:19.000 --> 00:32:22.039
<v Speaker 1>for microservices. How to boot and cloud fit together.

639
00:32:22.240 --> 00:32:25.480
<v Speaker 2>They're designed to work hand in glove. Springboot is perfect

640
00:32:25.480 --> 00:32:30.000
<v Speaker 2>for building the individual microservices self contained runnable jrs with

641
00:32:30.119 --> 00:32:34.200
<v Speaker 2>embedded servers. It aligns perfectly with those twelve factor app

642
00:32:34.200 --> 00:32:35.880
<v Speaker 2>principles needed for micro services.

643
00:32:36.119 --> 00:32:40.200
<v Speaker 1>Like codebase canfig dependencies processes exactly.

644
00:32:40.400 --> 00:32:44.039
<v Speaker 2>Springboot gives you the ideal building block. Spring Cloud then

645
00:32:44.119 --> 00:32:47.319
<v Speaker 2>provides the tools to handle the interactions and patterns needed

646
00:32:47.359 --> 00:32:49.200
<v Speaker 2>in a distributed microservice system.

647
00:32:49.440 --> 00:32:51.680
<v Speaker 1>And when we talk cloud development, it's more than just

648
00:32:51.880 --> 00:32:53.279
<v Speaker 1>deploying to AWS right.

649
00:32:53.319 --> 00:32:57.400
<v Speaker 2>It's about building applications natively for the cloud environment, leveraging elasticity,

650
00:32:57.519 --> 00:33:01.519
<v Speaker 2>fault tolerance, managed services, moving beyond just lifting and shifting

651
00:33:01.559 --> 00:33:03.799
<v Speaker 2>old apps to designing for the cloud from the start.

652
00:33:04.039 --> 00:33:06.839
<v Speaker 1>So what are some key spring Cloud technologies that help

653
00:33:06.880 --> 00:33:07.960
<v Speaker 1>manage this complexity?

654
00:33:08.000 --> 00:33:12.440
<v Speaker 2>Okay, several key ones. First, spring Cloud Console or Eureka

655
00:33:12.640 --> 00:33:16.559
<v Speaker 2>or Kubernety. Service discovery. It handles service registration and discovery.

656
00:33:16.839 --> 00:33:20.559
<v Speaker 2>Services register themselves and clients can dynamically find where other

657
00:33:20.599 --> 00:33:24.440
<v Speaker 2>services are running without hardcoding URLs. It can also manage

658
00:33:24.480 --> 00:33:26.279
<v Speaker 2>externalized configuration.

659
00:33:26.000 --> 00:33:27.720
<v Speaker 1>Essentral for dynamic environments.

660
00:33:27.960 --> 00:33:31.839
<v Speaker 2>What else spring Cloud open fame. This makes calling other

661
00:33:31.920 --> 00:33:35.440
<v Speaker 2>rest services incredibly easy. You just define a Java interface

662
00:33:35.480 --> 00:33:40.519
<v Speaker 2>with annotations and fine handles creating the HTTP client, doing

663
00:33:40.559 --> 00:33:45.240
<v Speaker 2>service discovery, client side load balancing. It feels like calling

664
00:33:45.240 --> 00:33:46.000
<v Speaker 2>a local method.

665
00:33:46.119 --> 00:33:50.519
<v Speaker 1>Nice abstraction. What about secrets, databased passwords, apikes?

666
00:33:50.759 --> 00:33:53.279
<v Speaker 2>Spring Cloud Vault. It integrates with how she co op

667
00:33:53.359 --> 00:33:57.160
<v Speaker 2>Vault or other secret managers to securely inject secrets into

668
00:33:57.160 --> 00:34:00.000
<v Speaker 2>your application and run time. No more secrets and properties,

669
00:34:00.039 --> 00:34:04.440
<v Speaker 2>files or environment variables. Volt handle secure storage, access control

670
00:34:04.640 --> 00:34:05.680
<v Speaker 2>and even secret.

671
00:34:05.480 --> 00:34:08.639
<v Speaker 1>Rotation critical for security. What about the entry point to

672
00:34:08.679 --> 00:34:09.360
<v Speaker 1>the whole system.

673
00:34:09.440 --> 00:34:12.239
<v Speaker 2>That's spring Cloud Gateway. It's an API gateway built on

674
00:34:12.320 --> 00:34:15.480
<v Speaker 2>spring webslucks, so it's reactive and non blocking. It provides

675
00:34:15.480 --> 00:34:17.800
<v Speaker 2>a single point of entry for all external requests. It

676
00:34:17.800 --> 00:34:21.440
<v Speaker 2>can handle routing, applying security filters like rate limiting or authentication,

677
00:34:22.039 --> 00:34:26.880
<v Speaker 2>load balancing, path rewriting, and implementing resilience patterns like circuit breaking.

678
00:34:27.159 --> 00:34:27.920
<v Speaker 1>Circuit breaks.

679
00:34:28.000 --> 00:34:30.880
<v Speaker 2>Yeah, if a downstream service starts failing, the gateway can

680
00:34:30.920 --> 00:34:33.599
<v Speaker 2>trip the circuit and stop setting request to it for

681
00:34:33.639 --> 00:34:37.920
<v Speaker 2>a while, preventing cascading failures and returning a fallback response instead.

682
00:34:38.039 --> 00:34:43.119
<v Speaker 1>Smart and finally, orchestrating all these containerized services Kubernetes absolutely.

683
00:34:43.400 --> 00:34:48.159
<v Speaker 2>Kubernetes k eights is the standard for container orchestration spring Cloud.

684
00:34:48.199 --> 00:34:53.119
<v Speaker 2>Kubernetes provides integrations spring Cloud Starter, Kuberneteses Client all so

685
00:34:53.199 --> 00:34:56.199
<v Speaker 2>your boot apps can seamlessly leverage K eight's features like

686
00:34:56.280 --> 00:35:00.840
<v Speaker 2>config maps for configuration, secrets for secrets management, and KAID

687
00:35:00.920 --> 00:35:04.639
<v Speaker 2>service discovery, all without much code change you deploy using

688
00:35:04.679 --> 00:35:07.039
<v Speaker 2>Kid's deployment and service ammal manifests.

689
00:35:07.119 --> 00:35:10.039
<v Speaker 1>So spring cloud provides the connective tissue for boot micro

690
00:35:10.079 --> 00:35:13.440
<v Speaker 1>services in a cloud environment. Okay, one more advanced topic,

691
00:35:13.840 --> 00:35:17.599
<v Speaker 1>extending boot itself with custom starters. Why bother creating your own?

692
00:35:17.840 --> 00:35:21.559
<v Speaker 2>The main reasons are speed, consistency, and maintainability within your

693
00:35:21.679 --> 00:35:24.440
<v Speaker 2>organization or team. If you have a common cross cutting

694
00:35:24.480 --> 00:35:28.119
<v Speaker 2>concern like specific auditing, security checks or client library setup,

695
00:35:28.559 --> 00:35:29.840
<v Speaker 2>you can package it as a starter.

696
00:35:30.000 --> 00:35:33.039
<v Speaker 1>So new projects just include your starter exactly.

697
00:35:33.239 --> 00:35:36.880
<v Speaker 2>They get all that boilerplate and configuration handled automatically, ensuring

698
00:35:36.920 --> 00:35:40.280
<v Speaker 2>everyone follows the same pattern. It reduces setup time, It

699
00:35:40.280 --> 00:35:42.800
<v Speaker 2>makes codebases more consistent and easier to maintain.

700
00:35:42.920 --> 00:35:45.840
<v Speaker 1>Is it like using spring zone at enable annotations at

701
00:35:45.920 --> 00:35:47.920
<v Speaker 1>enable web NBC at enable caching?

702
00:35:48.119 --> 00:35:52.639
<v Speaker 2>Very similar concept. Those annotations trigger auto configuration. You can

703
00:35:52.679 --> 00:35:55.280
<v Speaker 2>create your own custom that enable my feature annotation as

704
00:35:55.320 --> 00:35:57.760
<v Speaker 2>part of your starter to make it easy for users

705
00:35:57.800 --> 00:35:59.360
<v Speaker 2>to opt in to your functionality.

706
00:35:59.360 --> 00:36:02.199
<v Speaker 1>Declaratively, how are starters typically structured?

707
00:36:02.599 --> 00:36:06.320
<v Speaker 2>Usually as two modules. An autoconfigure module contains the core logic,

708
00:36:07.199 --> 00:36:11.880
<v Speaker 2>the at configuration or at autoconfiguration classes often conditional using

709
00:36:11.960 --> 00:36:16.760
<v Speaker 2>at conditional non annotations, any configuration properties, classes and the

710
00:36:16.760 --> 00:36:18.679
<v Speaker 2>logic itself like aspects or beans.

711
00:36:18.800 --> 00:36:20.119
<v Speaker 1>And the second module.

712
00:36:19.800 --> 00:36:22.280
<v Speaker 2>A starter module. This one's usually very simple. It just

713
00:36:22.320 --> 00:36:26.000
<v Speaker 2>declares dependencies on the autoconfigure module and any other third

714
00:36:26.000 --> 00:36:29.320
<v Speaker 2>party libraries. Your feature needs users, then just depend on

715
00:36:29.360 --> 00:36:31.199
<v Speaker 2>your my feature spring boots starter.

716
00:36:31.480 --> 00:36:32.679
<v Speaker 1>Can you give a quick example.

717
00:36:32.760 --> 00:36:35.800
<v Speaker 2>The book uses a my retroadit Starter example. It is

718
00:36:35.840 --> 00:36:39.599
<v Speaker 2>a custom in my retrodit annotation an aspect my retro

719
00:36:39.599 --> 00:36:43.360
<v Speaker 2>audit aspect uses at a round advice to intercept calls

720
00:36:43.360 --> 00:36:45.880
<v Speaker 2>to annotated methods and log ondit info, and the auto

721
00:36:45.960 --> 00:36:51.400
<v Speaker 2>configuration a my retroaddic configuration class marks at autoconfiguration conditionally

722
00:36:51.480 --> 00:36:54.920
<v Speaker 2>enables the aspect maybe based on a property or if

723
00:36:54.960 --> 00:36:58.159
<v Speaker 2>the custom at enable my retroad annotation is present, then

724
00:36:58.199 --> 00:37:01.840
<v Speaker 2>you register this autoconfiguration clas in the special meta and

725
00:37:02.079 --> 00:37:05.320
<v Speaker 2>f spring org dot, spring framework, dot boot, dot autoconfigure,

726
00:37:05.360 --> 00:37:07.679
<v Speaker 2>dot autoconfiguration dot imports.

727
00:37:07.280 --> 00:37:09.960
<v Speaker 1>File so it automatically wires up the auditing aspect if

728
00:37:09.960 --> 00:37:12.800
<v Speaker 1>the starter is included and enabled. Clever okay. Wrapping up

729
00:37:12.840 --> 00:37:15.280
<v Speaker 1>the book touches on some newer projects. What's exciting on

730
00:37:15.280 --> 00:37:16.320
<v Speaker 1>the horizon.

731
00:37:15.960 --> 00:37:19.079
<v Speaker 2>First, Spring modulith. This is interesting. It's not micro services,

732
00:37:19.280 --> 00:37:22.239
<v Speaker 2>but it helps structure larger spring Boot modulates into well

733
00:37:22.280 --> 00:37:23.760
<v Speaker 2>defined modules within the same.

734
00:37:23.599 --> 00:37:26.559
<v Speaker 1>Codebase, modularity inside the monolith exactly.

735
00:37:26.639 --> 00:37:30.599
<v Speaker 2>It helps enforce boundaries between modules, verifies dependencies of build time,

736
00:37:30.840 --> 00:37:34.079
<v Speaker 2>and can even generate diagrams of your module structure. It

737
00:37:34.199 --> 00:37:38.679
<v Speaker 2>encourages looser coupling, often through event driven communication between modules

738
00:37:38.719 --> 00:37:42.239
<v Speaker 2>instead of direct calls. It's about making monoliths more manageable,

739
00:37:42.280 --> 00:37:46.440
<v Speaker 2>a pragmatic approach. What else, Spring ai this is huge.

740
00:37:46.800 --> 00:37:50.599
<v Speaker 2>It's a new framework bringing AI capabilities, especially large language

741
00:37:50.599 --> 00:37:55.280
<v Speaker 2>models lms like GBT four directly into Spring applications.

742
00:37:54.920 --> 00:37:57.840
<v Speaker 1>Like Python's lang chain but for Java Spring.

743
00:37:57.800 --> 00:38:00.599
<v Speaker 2>Kind of yeah. It simplifies interacting with AIME models using

744
00:38:00.639 --> 00:38:05.079
<v Speaker 2>concepts like chat client prompt templates and handling embeddings numerical

745
00:38:05.079 --> 00:38:09.400
<v Speaker 2>representations of text for semantic understanding. Makes building AI powered

746
00:38:09.400 --> 00:38:10.559
<v Speaker 2>features in Spring much.

747
00:38:10.440 --> 00:38:13.000
<v Speaker 1>Easier, very cool and performance improvement.

748
00:38:13.159 --> 00:38:15.639
<v Speaker 2>Virtual threads from Jaba twenty one are now supported in

749
00:38:15.719 --> 00:38:18.800
<v Speaker 2>Spring Boot three point two plus okios. You just flip

750
00:38:18.840 --> 00:38:22.119
<v Speaker 2>a switch Spring dot threads dot virtual dot enable true

751
00:38:22.440 --> 00:38:25.440
<v Speaker 2>and tomcatter jety can start using lightweight virtual threads for

752
00:38:25.480 --> 00:38:26.400
<v Speaker 2>handling requests.

753
00:38:26.440 --> 00:38:27.199
<v Speaker 1>What's the benefit.

754
00:38:27.360 --> 00:38:32.639
<v Speaker 2>Potentially massive throughput improvements for iobound applications without complex ACYN

755
00:38:32.719 --> 00:38:35.719
<v Speaker 2>code because you can have millions of virtual threads with

756
00:38:35.960 --> 00:38:38.559
<v Speaker 2>very little overhead compared to traditional platform threads.

757
00:38:38.599 --> 00:38:43.840
<v Speaker 1>Wow, simple switch, big impact potentially. And finally, Graphql.

758
00:38:43.440 --> 00:38:46.159
<v Speaker 2>Yeah, graph L is gaining traction as an alternative to

759
00:38:46.239 --> 00:38:49.800
<v Speaker 2>rest It lets clients request exactly the data they need,

760
00:38:50.119 --> 00:38:54.960
<v Speaker 2>no more, no less, reducing overfetching. Spring for Graphql provides

761
00:38:55.039 --> 00:38:55.920
<v Speaker 2>excellent integration.

762
00:38:56.199 --> 00:38:56.960
<v Speaker 1>How does it work?

763
00:38:57.119 --> 00:39:00.639
<v Speaker 2>You define your API schema using GRAPHQOLS, Schema Definition Language

764
00:39:00.960 --> 00:39:04.440
<v Speaker 2>SDL and a dog graphcuels file. Then in your Spring

765
00:39:04.480 --> 00:39:07.599
<v Speaker 2>code you use annotations like at query mapping and at

766
00:39:07.679 --> 00:39:10.360
<v Speaker 2>mutation mapping on methods to implement the resolvers for your

767
00:39:10.360 --> 00:39:13.559
<v Speaker 2>schema fields. It also integrates with tools like graphuel for

768
00:39:13.599 --> 00:39:14.800
<v Speaker 2>interactive testing.

769
00:39:14.840 --> 00:39:18.039
<v Speaker 1>So a different way to build APIs fully supported. Wow. Okay,

770
00:39:18.079 --> 00:39:19.760
<v Speaker 1>we have covered a lot of ground here. It's been

771
00:39:19.760 --> 00:39:21.000
<v Speaker 1>a real deep dive, hasn't it.

772
00:39:21.079 --> 00:39:24.400
<v Speaker 2>Absolutely from the core ideas of autoconfiguration, right.

773
00:39:24.239 --> 00:39:27.719
<v Speaker 1>Through building web apps, data access messaging, then production stuff

774
00:39:27.760 --> 00:39:30.159
<v Speaker 1>like actuator testing, security.

775
00:39:29.920 --> 00:39:34.719
<v Speaker 2>Dative images. Spring Cloud for micro services even custom starters

776
00:39:34.840 --> 00:39:37.800
<v Speaker 2>and bleeding edge things like AI and virtual threads.

777
00:39:38.239 --> 00:39:41.119
<v Speaker 1>It really paints a picture of a comprehensive ecosystem.

778
00:39:41.239 --> 00:39:44.719
<v Speaker 2>It does. It's about enabling developers to build sophisticated systems

779
00:39:45.039 --> 00:39:48.679
<v Speaker 2>faster and more reliably, handling the boiler plate so you

780
00:39:48.679 --> 00:39:50.400
<v Speaker 2>can focus on the unique value.

781
00:39:50.840 --> 00:39:53.159
<v Speaker 1>So for you listening, what really stands out is how

782
00:39:53.239 --> 00:39:56.760
<v Speaker 1>Spring boot, with this whole rich ecosystem, acts like this

783
00:39:56.840 --> 00:40:01.199
<v Speaker 1>incredible orchestrator right. It lets you the developer, build complex

784
00:40:01.239 --> 00:40:04.280
<v Speaker 1>applications quickly without getting totally bogged down on the plumbing.

785
00:40:04.599 --> 00:40:07.280
<v Speaker 1>It empowers you to focus on your business logic. You

786
00:40:07.320 --> 00:40:09.960
<v Speaker 1>can really see how all these pieces from a simple

787
00:40:10.000 --> 00:40:13.880
<v Speaker 1>at rest controller to a full Kate's deployment fit together.

788
00:40:14.079 --> 00:40:16.519
<v Speaker 2>It gives you the tools and the patterns to build

789
00:40:16.599 --> 00:40:18.119
<v Speaker 2>modern software effectively.

790
00:40:18.199 --> 00:40:20.119
<v Speaker 1>And as we saw with things like Spring Modulus and

791
00:40:20.119 --> 00:40:23.400
<v Speaker 1>Spring AI, this whole landscape just keeps evolving, doesn't it.

792
00:40:23.559 --> 00:40:25.440
<v Speaker 1>So here's the thought to leave you with, what if

793
00:40:25.440 --> 00:40:28.079
<v Speaker 1>the next big leap isn't just about how services talk

794
00:40:28.119 --> 00:40:31.559
<v Speaker 1>to each other, but how entire applications, maybe modular ones

795
00:40:31.639 --> 00:40:35.280
<v Speaker 1>powered by AI can adapt and reconfigure themselves on the fly,

796
00:40:35.840 --> 00:40:39.199
<v Speaker 1>almost like biological systems. What new Aha moments are waiting

797
00:40:39.320 --> 00:40:42.159
<v Speaker 1>just around the corner in software architecture, Something to chew

798
00:40:42.159 --> 00:40:45.199
<v Speaker 1>on as you continue your own explorations in this fascinating world.
