大家知道springBoot发明的初衷是为了减少xml的配置,而dubbo的传统方式就是xml配置,所以既然用了springBoot就应该遵循它的规则,在集成dubbo时改为全编程式注解的方式。下面我来为大家详细介绍集成的步骤:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=C:/zookeeper-3.4.13/data
dataLogDir=C:/zookeeper-3.4.13/log
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
完成以上步骤后就可以进入C:\zookeeper-3.4.13\bin 双击zkserver.cmd启动zookper。
建议使用idea工具!!!我先是在本地磁盘建了一个文件夹springBoot-dubbo,然后选择File - open打开这个文件夹,接着在这个文件夹上创建model工程,如下图所示:
选择spring initializr
如果相同的依赖太多,你也可以考虑创建pom父工程,统一依赖管理。
1.服务者的pom.xml:
<?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
因篇幅问题不能全部显示,请点此查看更多更全内容