Nacos(需要下载控制面板)
- 服务发现
EnableDiscoveryClient 标注在启动类上
- 加载Nacos面板配置的信息
第一步
+ ConfigurationProperties(prefix="Nacos yml中的配置名称") 配置类
第二步
+ 通过Autowired获取配置类中的值
OpenFeign
- EnableFeignClients 标注在启动类上
- FeginClient 调用接口或者调用第三方接口
注意:打开兜底,必须安装sentinel
feign:
sentinel:
enable: false
- OpenFeign相关配置
- application.yml
Spring:
profiles:
include:加载config文件
- openFeign的配置文件
spring:
cloud:
openFeign:
client:
config:
Sentail(需要下载控制面板)
注意:在业务中标注@SentailResource
- 流控
- 模式:直接,关联,链路
- 效果:快速失败,冷启动,匀速排队
- 熔断
- 策略:慢调用比例,异常比例,比例数
GetWay
spring:
cloud:
getway:
routes:
- id 微服务名
uri lb://微服务名
# 断言
predicates
# 过滤
fifters
- 查看断言
1. ctrl+O routePredicatesFactory
2. ctrl+H
3. 去掉 routePredicatesFactory就是GetWay所有的断言
Seta
注意:Seta解决分布式事务中数据库数据不一致问题,也就是说通过OpenFeign调用的Web接口的,需要使用Seta
- GlobTractional 全局事务
- Transactional 本地事务
防抖
function debounce(fn,delay){
let timerId;
return ()=>{
clearTimeout(timerId);
timerId=setTimeout(()=>{
fn()
},delay)
}
}
节流
function throttle(fn,wait){
let lastTime=0;
return function(...args){
const now=new Date().getTime();
if(now-lastTime>wait){
lastTime=now;
return fn.apply(this,args)
}
}
}
Servlet
-
HttpServletRequest继承ServletRequest,一般要用HttpServletRequest
-
转发 Request.getRequestDispatcher(url).forword(request,response)
-
重定向 request.sendRedirect()
-
request.getParamter()
-
request.getAttribute()
-
request.getHeader() 获取请求头
-
request.getHeaderNames() 获取所有请求头
-
request.setCharacterEncoding()
-
request.getMethods()
-
request.getRequestURL()
-
request.getRequestURI()
-
request.getRemoteAddr() 获取主机地址
-
request.getScheme()获取请求协议 同理某些还包括Set方法
- 英语公式
- 动词形式
do 原形/一般 does 单三(第三人称单数) doing 正在进行/现在分词 done 已经完成/过去分词 did 过去式 to do 不定式 - be+ing
这个不仅仅是公式, 第一,这个表示正在进行 第二,和这个对应的叫做,have/has+done,叫已经完成 - 介词+名词/代词/动名词
- 情态动词+动词原形
- 冠词
a,o,e,i,u用an
the表示特指
- 定语从句
- 及物动词(不确定数量的词),thereBe,有人有物,序数词和最高级,特指词(The)
- 非限制性定语从句一般具有逗号,所以一般使用which,以及介词和that和those用which
- (疑问句)阅读理解询问句
- do+You/Are+You 没有动词原形用AreYou有动词原型用doYou
- what is 某某是什么
- There be 某某有某某
- That is 那是什么
- this is 这是什么
- why Are 询问原因
- When is 咨询时间/当什么什么
- How do 某某干什么
- How Much 咨询数量(不可数)
- How many 咨询数量(可数)
- Where 去哪里