- Mastering Microservices with Java
- Sourabh Sharma
- 328字
- 2021-07-02 13:03:40
Implementing a Microservice
This chapter takes you from the design stage to the implementation of our sample project—an online table reservation system (OTRS). Here, you will use the same design we explained in the last chapter and enhance it to build microservices. By the end of this chapter, you will have not only learned how to implement the design, but also the different aspects of microservices—building, testing, packaging, and containerization. Although the focus is on building and implementing the restaurant microservices, you can use the same approach to build and implement other microservices that are used in the OTRS. Sample code available on GitHub provides all three services in this chapter—the restaurant service, the booking service, and the user service.
In this chapter, we will cover the following topics:
- OTRS overview
- Developing and implementing the microservices
- Testing
- Containerization of microservices using Docker
We will use the concepts of domain-driven design that were demonstrated in the last chapter. In the last chapter, you saw how domain-driven design is used to develop the domain model using core Java. Now, we will move from a sample domain implementation to a Spring Framework-driven implementation. You'll make use of Spring Boot to implement the domain-driven design concepts and transform them from core Java to a Spring Framework-based model.
In addition, we'll also use Spring Cloud, which provides a cloud-ready solution that is available through Spring Boot. Spring Boot will allow you to use an embedded application container relying on Tomcat or Jetty inside your service, which is packaged as a JAR or as a WAR. This JAR is executed as a separate process, a microservice that will serve and provide the responses to all requests and point to endpoints that are defined in the service.
Spring Cloud can also be integrated easily with Netflix Eureka, a service registry and discovery component. The OTRS will use it for the registration and the discovery of microservices.
- Extending Jenkins
- 深入理解Bootstrap
- Kubernetes實戰
- MySQL 8從入門到精通(視頻教學版)
- Practical DevOps
- Python程序設計案例教程
- Hands-On Full Stack Development with Spring Boot 2.0 and React
- Windows Phone 8 Game Development
- Mastering Elixir
- Building Slack Bots
- MongoDB Cookbook(Second Edition)
- 虛擬現實建模與編程(SketchUp+OSG開發技術)
- 流暢的Python
- 深度學習的數學:使用Python語言
- LabVIEW案例實戰