1 Star 0 Fork 0

SaoTao / SpringCloud_Demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

SpringCloud_Demo

项目介绍

spring cloud上手测试

软件架构

软件架构说明 spring cloud相关框架测试

安装教程

  1. xxxx
  2. xxxx
  3. xxxx

使用说明

  1. xxxx
  2. xxxx
  3. xxxx

参与贡献

  1. Fork 本项目
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

异常记录:

  1. spring boot 2.0.0.RELEASE必须与cloud的Finchley.SR1(及以上版本搭配使用)否则报错: java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.([Ljava

  2. 若没有使用数据源则需要在主启动类加注解时加入exclude如:@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) 否则报错: Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.

  3. Parameter 0 of constructor in com.tao.springcloud.cfgbeans.ConfigBeans required a bean of type 'org.springframework.web.client.RestTemplate' that could not be found.

  4. 配置eureka集群时,hostname中不能有下划线 否则出现一下异常 o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> replica.key [in template "eureka/navbar.ftl" at line 68, column 62]

  5. spring cloud2 hystrix没有/actuator/hystrix.stream路径:需要在启动类添加servlet代码才能查看详见spring-cloud-server-hystrix启动类

IDEA操作记录:

1.热部署: 只需要添加devtools依赖即可 org.springframework.boot spring-boot-devtools true true JVM会定时扫描重新加载且仅加载有改动的类文件(.class文件),而不是加载所有的类文件,大大减少了类加载耗费的时间,从而实现热部署的功能。 Eclipse默认自动编译,而idea默认手动编译,因此idea需要修改两个参数以达到任意时间自动编译的目的。 首先,File->setting->搜索compiler->将Build project automatically打勾(yml可能需要在上面添加支持) (注意后面only works not running/debugging,所以我们要实现热部署就必须打破这个限制,于是乎有了下面设置) 然后,CTRL+ALT+SHIFT+/ 组合键打开 Maintenance窗口选择Registry... ,找到compiler.automake.allow.when.app.running选项,打勾开启运行时编译功能(找了半天才发现是按字母排序的)

  1. 安装spring Assistant可以辅助填充yml

思考: 1.spring-cloud-server在项目中可以看到是包含有3个module(server01/server02/server03),3个最大的区别在于数据源不同(代码相同),3个组合在一起类似于集群服务;在实际运用中应该是一套代码部署3套, 而不是像现在这样,或者本案例只是通过3个module模拟集群;(eureka集群也有类似问题)

####### hystrix: http://localhost:3083/hystrix

码云特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. 码云官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解码云上的优秀开源项目
  4. GVP 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
  5. 码云官方提供的使用手册 https://gitee.com/help
  6. 码云封面人物是一档用来展示码云会员风采的栏目 https://gitee.com/gitee-stars/

空文件

简介

spring cloud上手测试 展开 收起
Java
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/olywa/SpringCloud_Demo.git
git@gitee.com:olywa/SpringCloud_Demo.git
olywa
SpringCloud_Demo
SpringCloud_Demo
master

搜索帮助