The previous article is the SSM Maven single project (http://www.cnblogs.com/yuanjava/p/6748956.html). Medium is the SSM MAVEN multi-engineering (http://www.cnblogs.com/yuanjava/p/6886099.html). This next chapter is to take medium's service as a service provider for Contoller consumer calls. Then the service Terminal Services with Dubbo to register the service to the Registration Center (zookeeper), the consumer subscription to the Registry service address, according to the address to the server to find the corresponding service call.
Project code GitHub Address: Https://github.com/liuxiaoshi/liuxs-parent
I. Create a project
Medium Our project is
Lxs-parent (Parent engineering Pom)
----------Lxs-common (sub-project jar corresponding to Utils in the original project)
---------lxs-web-parent (POM, sub-engineering polymerization engineering)
----------Lxs-pojo (sub-module jar corresponding to the original project Pojo package)
----------Lxs-mapper (sub-module jar corresponding to the original project DAO package)
----------Lxs-service (sub-module jar corresponding to the original engineering service interface and implementation Class)
----------Lxs-web (sub-module war)
In fact, you can also remove lxs-web-parent all the works into the lxs-parent. This time, all the projects were aggregated to lxs-parent. The Lxs-service module is also pulled out as a war service provider. Also because the service interface consumer is called, because the interface to pull out a jar package.
This project structure is
Liuxs-parent (Parent Engineering pom Polymerization project)
----------Liuxs-common (sub-project jar corresponding to Utils in the original project)
----------Liuxs-pojo (sub-module jar corresponding to the original project Pojo package)
----------Liuxs-interface (sub-module jar corresponding to the original engineering interface)
----------Lxs-mapper (sub-module jar corresponding to the original project DAO package)
----------Liuxs-provider-web (sub-module war service offers service pack)
----------Liuxs-consumer-web (sub-module War consumer Contoller package)
Create a parent project Liuxs-parent
Create sub-modules separately
Create Liuxs-common
Create a Liuxs-provider-web War package
The others are not created, the final project directory is like this
Second: Modify dependencies, etc.
The parent project joins the Dubbo and zookeeper packages, because the Dubbo-dependent spring seems to conflict with spring4.3 and therefore excludes
Three: the original project corresponding module and code moved to the multi-module project
This step is similar to the move in the previous article.
Liuxs-provider-web Increase Dubbo-provider.xml
The contents are as follows:
Liuxs-consumer-web Increase Dubbo-consumer.xml
The contents are as follows
Four: Test results
Install the corresponding zookeeper and Dubbo consoles (http://www.cnblogs.com/yuanjava/p/6793251.html)
Start service provider Liuxs-provider-web, see the server provider in the Dubbo console
Then start the consumer Liuxs-consumer-web, and in the Dubbo console the consumer sees the corresponding consumer
Last Run result
Dubbo-based SSM (Spring,springmvc,mybatis) integrated MAVEN multi-project (bottom)