- Mastering Microservices with Java
- Sourabh Sharma
- 121字
- 2021-07-02 13:03:41
Restaurant service implementation
Here, the restaurant service implementation is explained. You can take the same approach to develop other services.
It is recommended to download the code for this chapter from the GitHub repository/Packt website.
We'll start the restaurant-service module (mvn) by creating the restaurant-service POM inside the restaurant-service directory. We have added docker-maven-plugin to build the Docker image of the executable service that we'll discuss later in this chapter.
After this, we can add Java classes and other files. First, we'll add pom.xml:
...
<parent>
<groupId>com.packtpub.mmj</groupId>
<artifactId>11537_chapter4</artifactId>
<version>PACKT-SNAPSHOT</version>
</parent>
<name>online-table-reservation:restaurant-service</name>
<artifactId>restaurant-service</artifactId>
<packaging>jar</packaging>
<properties>
<start-class>com.packtpub.mmj.restaurant.RestaurantApp</start-class>
<docker.registry.name>localhost:5000/</docker.registry.name>
<docker.repository.name>${docker.registry.name}sourabhh/
${project.artifactId}</docker.repository.name>
<docker.host.address>192.168.43.194</docker.host.address>
<docker.port>8080</docker.port>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<!-- Testing starter -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
<build>
...
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.13.9</version>
<configuration>
...
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
...
...
</build>
</project>
Please refer to the Git repository for the complete code: https://github.com/PacktPublishing/Mastering-Microservices-with-Java-Third-Edition.
推薦閱讀
- Practical Data Analysis Cookbook
- What's New in TensorFlow 2.0
- PHP基礎案例教程
- Visual FoxPro 程序設計
- TestNG Beginner's Guide
- Java程序設計與計算思維
- jQuery從入門到精通 (軟件開發視頻大講堂)
- Processing互動編程藝術
- 高級C/C++編譯技術(典藏版)
- 速學Python:程序設計從入門到進階
- IBM Cognos Business Intelligence 10.1 Dashboarding cookbook
- Vue.js光速入門及企業項目開發實戰
- MyBatis 3源碼深度解析
- AI自動化測試:技術原理、平臺搭建與工程實踐
- Learning D3.js 5 Mapping(Second Edition)