- Page 2 and 3: EDITION v6.0 - Updated to ASP.NET C
- Page 4 and 5: The second part of the guide starts
- Page 6 and 7: All rights reserved. No part of the
- Page 8 and 9: Manage state and data in Docker app
- Page 10 and 11: Simplified workflow when developing
- Page 12 and 13: Design a microservice domain model
- Page 14 and 15: Issues with the original HttpClient
- Page 16 and 17: CHAPTER 1Introduction to Containers
- Page 18 and 19: directly on macOS.) Developers who
- Page 20 and 21: 2. To issue a set of letters, you p
- Page 22 and 23: you can deploy the whole multi-cont
- Page 24 and 25: CHAPTER 2Choosing Between .NET 6and
- Page 26 and 27: can use it to develop containerized
- Page 30 and 31: Figure 3-1. Operating systems to ta
- Page 32 and 33: In productionWhat is important in p
- Page 34 and 35: You might find a scenario where you
- Page 36 and 37: Figure 4-3. Example of multiple hos
- Page 38 and 39: should assume that container images
- Page 40 and 41: • File storage offers shared stor
- Page 42 and 43: evolve them autonomously while main
- Page 44 and 45: be accessed either synchronously th
- Page 46 and 47: As Figure 4-8 shows, the catalog bu
- Page 48 and 49: scalability in collaborative scenar
- Page 50 and 51: Challenge #4: How to design communi
- Page 52 and 53: Sam Newman, a recognized promoter o
- Page 54 and 55: Figure 4-11. Decomposing traditiona
- Page 56 and 57: • How can client apps minimize th
- Page 58 and 59: Figure 4-13. Using an API Gateway i
- Page 60 and 61: For more information, see Gateway r
- Page 62 and 63: using PaaS products like Azure API
- Page 64 and 65: A microservices-based application i
- Page 66 and 67: Figure 4-15. Anti-patterns and patt
- Page 68 and 69: When a client uses request/response
- Page 70 and 71: Azure Service Bus. In this scenario
- Page 72 and 73: and Query Responsibility Segregatio
- Page 74 and 75: Creating, evolving, and versioning
- Page 76 and 77: consuming the microservices, which
- Page 78 and 79:
• Mauro Servienti. The secret of
- Page 80 and 81:
Orchestrators managing health and d
- Page 82 and 83:
Figure 4-23. A cluster of container
- Page 84 and 85:
configuration of popular open-sourc
- Page 86 and 87:
For more implementation information
- Page 88 and 89:
Additional resources• Visual Stud
- Page 90 and 91:
Step 1. Start coding and create you
- Page 92 and 93:
Figure 5-3. Enabling Docker Support
- Page 94 and 95:
• Build your own image. In the of
- Page 96 and 97:
• Line #5: Begin a new stage with
- Page 98 and 99:
Step 3. Create your custom Docker i
- Page 100 and 101:
- sqldatasqldata:image: mcr.microso
- Page 102 and 103:
Option A: Running a single-containe
- Page 104 and 105:
Additional resources• Deploy an A
- Page 106 and 107:
Figure 5-15. Simplified workflow wh
- Page 108 and 109:
CHAPTER 5Designing and DevelopingMu
- Page 110 and 111:
In this approach, each service (con
- Page 112 and 113:
Data sovereignty per microserviceIn
- Page 114 and 115:
Yet another drawback with this dire
- Page 116 and 117:
• Traditional N-Layered.• Domai
- Page 118 and 119:
Figure 6-5. Simple data-driven/CRUD
- Page 120 and 121:
Figure 6-7. Dependencies in a simpl
- Page 122 and 123:
Within the DbContext, you use the O
- Page 124 and 125:
});});// Changing default behavior
- Page 126 and 127:
Query string and URI versioning are
- Page 128 and 129:
Swashbuckle automatically generates
- Page 130 and 131:
Figure 6-9. Swashbuckle UI testing
- Page 132 and 133:
Basically, you define each of the c
- Page 134 and 135:
depends_on:- sqldataThis containeri
- Page 136 and 137:
Overriding the base docker-compose
- Page 138 and 139:
image: eshop/webmvc:${TAG:-latest}b
- Page 140 and 141:
webmvc:environment:- ASPNETCORE_ENV
- Page 142 and 143:
A Dockerfile like this will work. H
- Page 144 and 145:
environments so that you can easily
- Page 146 and 147:
pod}}}}return host;The following co
- Page 148 and 149:
You can directly run a Docker Redis
- Page 150 and 151:
you can research the forked eShopOn
- Page 152 and 153:
In Figure 6-20, you can see an abst
- Page 154 and 155:
Figure 6-21. RabbitMQ implementatio
- Page 156 and 157:
Each event type has a related chann
- Page 158 and 159:
}// ...In this case, since the orig
- Page 160 and 161:
• Publish the integration event r
- Page 162 and 163:
if (catalogItem == null) return Not
- Page 164 and 165:
The event handler needs to verify w
- Page 166 and 167:
Deduplicating messages when using R
- Page 168 and 169:
• Service tests. These tests ensu
- Page 170 and 171:
• Unit testing in .NET using dotn
- Page 172 and 173:
redis.data:ports:- "6379:6379"rabbi
- Page 174 and 175:
SignalR is one example of an artifa
- Page 176 and 177:
}finally{// Wait until the task com
- Page 178 and 179:
for these scenarios, like Azure Fun
- Page 180 and 181:
Sample microservices/containers to
- Page 182 and 183:
ports:- "5101:80" # Important: In a
- Page 184 and 185:
You install Ocelot and its dependen
- Page 186 and 187:
The main functionality of an Ocelot
- Page 188 and 189:
build:context: .dockerfile: src/Api
- Page 190 and 191:
Figure 6-36. Direct access to a mic
- Page 192 and 193:
Figure 6-39. Position of the Identi
- Page 194 and 195:
}}}//...Then, you also need to set
- Page 196 and 197:
exposes just a few services or endp
- Page 198 and 199:
Figure 7-1. External microservice a
- Page 200 and 201:
CQS is a simple concept: it is abou
- Page 202 and 203:
Therefore, you could use a differen
- Page 204 and 205:
definitions query the database and
- Page 206 and 207:
}}}LEFT JOIN[ordering].[orderstatus
- Page 208 and 209:
In the following image, you can see
- Page 210 and 211:
Layers in DDD microservicesMost ent
- Page 212 and 213:
Also, this aspect does not mean you
- Page 214 and 215:
The Domain Entity patternEntities r
- Page 216 and 217:
• Martin Fowler. The Anemic Domai
- Page 218 and 219:
Figure 7-9. Example of aggregates w
- Page 220 and 221:
Figure 7-10. Domain model structure
- Page 222 and 223:
Address = address;}// ...Additional
- Page 224 and 225:
Additionally, if there are differen
- Page 226 and 227:
The custom Entity base classThe fol
- Page 228 and 229:
Order Add(Order order);void Update(
- Page 230 and 231:
constructed, you must provide the r
- Page 232 and 233:
It could be argued that value objec
- Page 234 and 235:
}modelBuilder.ApplyConfiguration(ne
- Page 236 and 237:
• No inheritance-mapping support
- Page 238 and 239:
You can use this class as a type in
- Page 240 and 241:
for entity validation in EF Core (n
- Page 242 and 243:
because if you have a client applic
- Page 244 and 245:
Domain events versus integration ev
- Page 246 and 247:
As shown in Figure 7-15, starting f
- Page 248 and 249:
However, when the domain events cla
- Page 250 and 251:
Vaughn Vernon says the following in
- Page 252 and 253:
In code, you first need to register
- Page 254 and 255:
The reference app uses MediatR to p
- Page 256 and 257:
Figure 7-17. The relationship betwe
- Page 258 and 259:
object (as in EF when using the DbC
- Page 260 and 261:
Infrastructure in Entity Framework
- Page 262 and 263:
}get{}return _context;public BuyerR
- Page 264 and 265:
In short, custom repositories allow
- Page 266 and 267:
Fluent API and the OnModelCreating
- Page 268 and 269:
EF Core supports HiLo with the UseH
- Page 270 and 271:
}// return the result of the query
- Page 272 and 273:
worldwide, single-digit millisecond
- Page 274 and 275:
The ideal and more straightforward
- Page 276 and 277:
However, if you are planning to use
- Page 278 and 279:
[BsonId][BsonRepresentation(BsonTyp
- Page 280 and 281:
#Other environment variables for ad
- Page 282 and 283:
• Inversion of Control Containers
- Page 284 and 285:
foreach (var item in message.OrderI
- Page 286 and 287:
In the example code, the abstractio
- Page 288 and 289:
You send a command to a single rece
- Page 290 and 291:
data, and no behavior. The command
- Page 292 and 293:
IIdentityService identityService,IL
- Page 294 and 295:
Figure 7-25. Using the Mediator pat
- Page 296 and 297:
Additionally, async commands are on
- Page 298 and 299:
var requestCreateOrder = new Identi
- Page 300 and 301:
command);CommandHandler// Send the
- Page 302 and 303:
}}// Other types registration//...T
- Page 304 and 305:
RuleFor(command => command.City).No
- Page 306 and 307:
CHAPTER 7Implement resilientapplica
- Page 308 and 309:
Figure 8-2. The impact of having an
- Page 310 and 311:
certain failure scenarios faster th
- Page 312 and 313:
// Save product's data and publish
- Page 314 and 315:
available under heavy loads. That i
- Page 316 and 317:
In the above image, a ClientService
- Page 318 and 319:
A Typed Client is effectively a tra
- Page 320 and 321:
Add a jitter strategy to the retry
- Page 322 and 323:
In the code example above, the circ
- Page 324 and 325:
on. (Business message due to Circui
- Page 326 and 327:
In the previous code, the services.
- Page 328 and 329:
Figure 8-7. Custom Health Checks im
- Page 330 and 331:
Fortunately, AspNetCore.Diagnostics
- Page 332 and 333:
You can use simple custom applicati
- Page 334 and 335:
Directory or a dedicated authentica
- Page 336 and 337:
Authenticate with external provider
- Page 338 and 339:
To enable token authentication, ASP
- Page 340 and 341:
}services.AddSingleton<IClientStore
- Page 342 and 343:
About authorization in .NET microse
- Page 344 and 345:
The second AddPolicy call demonstra
- Page 346 and 347:
<PropertyGroup><UserSecretsId>Uniqu
- Page 348 and 349:
CHAPTER 9.NET MicroservicesArchitec