美文网首页
【原】SpringBoot知识点——SpringBoot篇

【原】SpringBoot知识点——SpringBoot篇

作者: 曹赫洋 | 来源:发表于2018-04-19 16:41 被阅读0次

基础

1.1 Spring Boot CLI

控制台命令工具

核心

2.1 几个核心注解

  • @SpringBootApplication
  • @EnableAutoConfiguration
  • @Configuration
  • @ComponentScan
  • @PropertySource :可以从properties文件中,获取对应的key-value,1.3.8前不支持yaml,后期不知道。
  • @ImportResource:加载xml
  • @ConfigurationProperties:也可以通过localtion指定位置
  • autoconfigure.condition包下的条件化启用自动依赖的注解要看下

2.2 Profile配置

application-{profile}.properties 形式
application.properties 里通过spring.profiles.active={profile}配置

2.3 查看报告

debug=true

2.4 自动配置

spring.factories很关键

2.5 扩展自自定义条件化注解

Web简化开发

3.1 模板引擎

  • thymeleaf模板基础
  • SpringTemplateEngine 和ThymeleafViewResolver bean的配置相关
  • 自动配置的ViewResolver,ContentNegotiatingViewResolver的理解。
  • 常用的ViewResolver:InternalResourceViewResolver

3.2 静态资源的处理

  • 自动的静态资源处理部分,WebMvcConfigurerAdapter的addResourceHandlers方法
  • 静态资源处理的扩展配置

3.3 Converter和Formatter

3.4 扩展配置

  • 无需使用@EnableWebMvc,config类继承WebMvcConfigurerAdapter的扩展理解
  • 注册servlet filter listener

3.5 SSL的配置

3.6 Favicon的配置

3.7 websocket

数据访问

4.1 spring data repository

4.2 spring data jpa

4.3 自定义repository

4.4 spring的声明式事务

  • @EnableTransactionManagement注解
  • @Transactional注解 可以指定XXX异常回滚,XXX异常不回滚

4.5 缓存支持

  • @EnableCaching注解
  • @Cacheable,@CachePut,@CacheEvict,@CacheConfig
  • 加入不同的缓存依赖,即切换不同的缓存,个人理解这种方法使用缓存结果较为简单,但是需要考虑redis cluster和redis Sentinel的扩展实现。

4.6 NOSQL

  • 例如 Mongo,继承 MongoRepository<T,S>,@EnableMongoRepositories注解
  • redis 也是 nosql,重点解读redis的几种Serializer,以及自定义Serializer与例如jackson2序列话器的配合;

企业开发

5.1 Spring Security

不基于spring boot

  • AbstractSecurityWebApplicationInitializer的理解,扩展等(不基于spring boot)

基于spring boot

  • @EnableWebSecurity 开启
  • 定制登录行为等
  • SecurityAutoConfiguration类的理解。
  • 写一个使用@Configuration的类,继承WebSecurityConfigurerAdapter进行自己的扩展

5.2 Spring Batch 大量数据操作框架

  • 基础理解概念
  • 数据处理和校验(实现ItemProcessor接口)
  • 自定义数据校验器
  • 参数后置绑定

5.3 异步消息

  • JMQ activemq
  • AMQP rabbitmq

5.4 Spring Ingegration 不同系统之间的交互问题

  • Message、Channel、Message EndPoint的理解
  • Message、Channel、Message EndPoint常用类型的了解
  • spring integration java dsl 理解使用

开发部署测试

6.1 热部署

  • spring-boot-devtools(关键)
  • thymeleaf的html修改之后的快速生效问题
  • Spring loaded
  • JRebel 收费(了解即可)

6.2 常规部署

  • 常规java -jar
  • 注册为linux服务
  • 打包成war包
  • 基于docker的部署方式

应用监控

7.1 actuator应用端口端点指标监控

  • 一些endpoints端点指标
  • 自定义定义端点

7.2 JMS监控

7.3 SSH或TELENT监控

  • spring-boot-starter-remote-shell 依赖
  • securecrt puTTY客户端,一些常用命令
  • 定制用户登录,groovy来扩展命令,

相关文章

网友评论

      本文标题:【原】SpringBoot知识点——SpringBoot篇

      本文链接:https://www.haomeiwen.com/subject/jqnwkftx.html