
spring boot
Cryaze
这个作者很懒,什么都没留下…
展开
-
电商中的三层缓存架构
在乐优商城中,在访问商品详情页中使用了三层缓存架构。redis,nginx,ehcache,三层缓存1.当消息访问*(请求来了)时,请求进入nginx*(路由转发)**中,这个nginx有着流量分发的功能。这个时候就需要将商品详情页显示出来。2.上一个nginx将请求分发到应用层的nginx。 静态页面是在这个nginx中进行动态渲染和存储的,渲染方式使用的是nginx+lua脚本。...原创 2019-11-28 16:15:44 · 418 阅读 · 0 评论 -
spring中application.yml中配置忽略json中的空值
spring中application.yml中配置忽略json中的空值spring: jackson: default-property-inclusion: non_null #配置json处理时忽略空值原创 2019-09-04 20:56:02 · 582 阅读 · 0 评论 -
Spring Data Elasticsearch
Elasticsearch在spring中的使用方法实体类及注解:package com.nc.es.pojo;import org.springframework.data.annotation.Id;import org.springframework.data.elasticsearch.annotations.Document;import org.springframewor...原创 2019-09-03 19:12:05 · 254 阅读 · 0 评论 -
前端传参方式与spring mvc接收参数方式
get请求的headers中没有content-type这个字段,get请求的参数在url的?后面,请求参数是Query String Parameters;Spring MVC使用注解:@RequestParam来接受参数我们目前常见的post请求的content-type有以下两种Content-Type: application/x-www-form-urlenco...原创 2019-08-30 20:20:00 · 305 阅读 · 0 评论 -
@PathVariable,@RequestParam,@RequestBody小结
1.@PathVariable当从前端传输的URL是 http://路径/参数 的时候要使用@PathVariable注解接收参数代码样式@GetMapping("groups/{cid}") public ResponseEntity<List<SpecGroup>> queryGroupsByCid(@PathVariable("cid")Long...原创 2019-08-28 20:28:32 · 251 阅读 · 0 评论 -
SpringBoot注解大全
SpringBoot注解大全一、注解(annotations)列表@SpringBootApplication:包含了@ComponentScan、@Configuration和@EnableAutoConfiguration注解。其中@ComponentScan让spring Boot扫描到Configuration类并把它加入到程序上下文。@Configuration 等同于spring...原创 2019-08-26 22:56:33 · 178 阅读 · 0 评论 -
mybatis通用Mapper的简单使用
//SELECT id,user_name,password,name,age,sex,birthday,created,updated FROM t_user WHERE ( age=? ) 根据年龄就行查询 @Test public void test1(){ User user = new User(); user.setAge(28);...原创 2019-08-21 17:03:04 · 352 阅读 · 0 评论 -
hystrix的小总结
hystrix 1.pom文件中添加依赖: spring-cloud-starter-netflix-hystrix 2.在启动类上,添加@EnableCircuitBreaker注解 3.在需要降级的方法上加上注解:@HystrixCommand(fallbackMethod="queryByIdfallback") 其中queryByIdfallback是服务降级的方法...原创 2019-08-24 20:27:43 · 200 阅读 · 0 评论 -
Eureka学习
Eureka 1.eureka server 使用: 1.引用spring-cloud-starter-netflex-eureka-server 2.配置端口 3. register-with-eureka: false #不向注册中心注册自己 fetch-registry: false #不向注册中心拉取服务列表 4.调优 ...原创 2019-08-24 10:43:35 · 151 阅读 · 0 评论 -
基于Hystrix的spring boot的容错机制
基于Hystrix的spring boot的容错机制摘要:在系统服务中,会存在因为过多的用户请求从而引发出系统崩溃的现象,为了防范这种现象的产生在系统服务中引入了容错机制。在微服务架构系统服务中,为了防止产生系统崩溃现象,在spring boot中加入了Hystrix的容错组件。Hystrix是一个实现超时机制和断路器模式的工具类库。当架构中的某一组件发生故障时,Hystrix组件通过断路器等一...原创 2019-06-27 11:37:03 · 980 阅读 · 0 评论