Chapter 8. Introducing OWIN: writing and testing OWIN middleware
This chapter covers
- Handling concerns that cut across several microservices
- Understanding OWIN, OWIN middleware, and OWIN pipelines
- Writing OWIN middleware
- Testing OWIN middleware and an OWIN pipeline
When you’re implementing a system of microservices, some concerns cut across the entire system. These are the things you need every microservice to do, and they’re often related to keeping the system healthy in production:
- Monitoring
- Logging errors, requests, performance, and so on
- Security
- Policies related to technologies you use in many microservices—for example, handling database connections
All of these lend themselves well to being implemented as OWIN middleware. This chapter explores how to use OWIN middleware to handle cross-cutting concerns.
When you look at a single microservice, you see number of components. For instance, chapter 2 broke the Shopping Cart microservice down into the components shown in figure 8.1.
Figure 8.1. The view of the Shopping Cart microservice you’ve seen in earlier chapters shows a small number of components that together implement the Shopping microservice behavior.
