1、Dubbo集成
上面文章已经部署了Dubbo并且已经集成了Mysql,本文以用户中心服务向其他服务提供用户查询接口为例,整理在集成Dubbo过程中的一些配置和问题。
1.1、ac-client模块
该模块以sdk的方式为其他服务提供查询能力,我们之前已经有maven搭建的经验了,此处不再赘述配置过程,直接以pom文件的方式展示该module,其中的common包可忽略(为了方便其他服务统一结果集、工具、异常,自己打包的sdk)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.cj</groupId>
<artifactId>ac</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>com.cj.ac</groupId>
<artifactId>ac-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.cj</groupId>
<artifactId>common</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>