本文主要是springcloud入门提现分布式服务架构
一、这里主要有三个角色:服务注册中心、服务提供者、服务消费者
二、主要的功能为两个模块分布在不同的机器上服务消费者进行调用服务提供者,这里不涉及业务逻辑和crud操作
三、博主亲测可跑,如有问题可以联系博主QQ372445135,话不啰嗦上代码
四、工程创建:
1、首先创建一个maven、springboot工程用于作为服务注册中心(功能1.注册服务、2.服务消费发现服务)
这里我是手动创建maven工程主要包括pom文件和对应的src文件即可

pom文件添加依赖如下
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.RC1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!--eureka server -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifa
482




被折叠的 条评论
为什么被折叠?



