一.新建微服务流程

1.copy已有微服务项目,修改微服务名字

education-websit

2.修改pom

<artifactId>education-websit</artifactId>

为微服务名字

3.在父项目pom中添加子模块

<modules>
    <module>education-website</module>
</modules>
4.添加gateway网关  bootstrap配置文件(有后缀的三个)
- id: education-website
  uri: lb://education-website
  order: 0
  predicates:
    - Path=/website/**
  filters:
    - StripPrefix=1

- id: education-website-logic-engine
  uri: lb://education-website
  predicates:
    - Path=/logic-engine/website/**
5.修改启动类名称
EducationWebsiteApplication
6.修改配置文件端口和一些名字为education-website的地方
7.启动项目发现报
java.nio.charset.MalformedInputException: Input length = 1
原因:项目编码与配置文件编码不一致
解决方案:1.项目设置默认编码 2.添加启动参数VM options:-Dfile.encoding=utf-8
注:如果不行就刷新maven,记住,怀疑是缓存的话就重编译项目,刷新maven
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值