官术网_书友最值得收藏!

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.
主站蜘蛛池模板: 云林县| 洪江市| 屯门区| 墨脱县| 达拉特旗| 夏津县| 闽侯县| 伊金霍洛旗| 政和县| 土默特右旗| 遵义县| 北流市| 莆田市| 中宁县| 怀化市| 柏乡县| 宾川县| 苍梧县| 通化县| 渑池县| 伊金霍洛旗| 维西| 惠州市| 双辽市| 电白县| 玛纳斯县| 嘉义县| 三河市| 孝感市| 兴宁市| 蓬溪县| 介休市| 长沙市| 叶城县| 镇雄县| 娄烦县| 松阳县| 广东省| 乡城县| 丹江口市| 民县|