SpringBoot(Basic)

spring boot
重要插件:
  maven-shade-plugin
  spring-boot-maven-plugin

重要命令:
  mvn spring-boot:run
  java -jar xxx.jar
  java -jar xxx.war
  java -jar xxx.war --spring.profiles.active=prod

启动流程:
  1.spring boot应用打包之后,生成一个fat jar,里面包含了应用依赖的jar包,还有Spring boot loader相关的类
  2.Fat jar的启动Main函数是JarLauncher,它负责创建一个LaunchedURLClassLoader来加载/lib下面的jar,并以一个新线程启动应用的Main函数。
  (LaunchedURLClassLoader和普通的URLClassLoader的不同之处是,它提供了从Archive里加载.class的能力)
  (spring boot在启动时,先通过一个简单的查找Servlet类的方式来判断是不是在web环境,
  如果是的话,则会创建AnnotationConfigEmbeddedWebApplicationContext,
  否则Spring context就是AnnotationConfigApplicationContext)

基本组件:
  (非web)spring-boot-starter
  (web)spring-boot-starter-web

测试组件:
  spring-boot-starter-test

重要组件:
    Spring Boot Actuator
    spring Boot Starters
    (spring-boot-starter-actuator)
    (spring-boot-starter-remote-shell)


重要属性:
   endpoints.shutdown.sensitive=false    (no-auth)
   endpoints.shutdown.enabled=true    (curl -X POST localhost:port/shutdown)


重要辅助:
    chrome: ctrl+shift+n
            ctrl+shift+f5 ctrl+shift+r 强制刷新(不使用本地缓存)

            ctrl+f5  or ctrl+r or f5 刷新(使用本地缓存或者内存缓存)

            f12 or ctrl+shift+i


    client强制nginx不缓存:
        Cache-control:no-cache、no-store

    nginx强制nginx不缓存:
        proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;


spring cloud
   config             配置 配置中心(configcenter)  (config server + config client)

   netflix euraka     疑惑 服务发现器(discovery)   (eureka server + eureka client)

   netflix hystrix    豪猪 断路器(circuit braker)

   netflix zuul       祖鲁 负载均衡器(load balancer for server)

   netflix ribbon     布条 负载均衡器(load balancer for client) 

   netflix archaius        配置管理api
   netfix turbine     汽轮机 仪表(dashboard)
   netflix feign      伪装 rest客户端
   bus                总线 消息
   sleuth             足迹 追踪器

 

转载于:https://my.oschina.net/igooglezm/blog/883946

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值