Wesley13 Wesley13
3年前
java常见的 http 请求库比较
java常见的http请求库有httpclient,RestTemplate,OKhttp,更高层次封装的feign、retrofit1、HttpClientHttpClient:代码复杂,还得操心资源回收等。代码很复杂,冗余代码多,不建议直接使用。2、RestTemplateRestTemplate:是Spring提供的用于访问
Stella981 Stella981
3年前
Spring Boot系列(八) Spring Boot中使用MongoDB数据库
MongoDB是一个开源的NoSQL文档数据库,它使用一个JSON格式的模式(schema)替换了传统的基于表的关系数据。SpringBoot为使用MongoDB提供了很多便利,包括springbootstarterdatamongodb'StarterPOM'。引入springbootstarterdatamongodb包,在po
Stella981 Stella981
3年前
Spring 源码(九)@Autowired注解实现原理(Spring Bean的自动装配)
@Autowired注解的实现过程,其实就是SpringBean的自动装配过程。通过看@Autowired源码注释部分我们可以看到@Autowired的实现是通过AutowiredAnnotationBeanPostProcessor后置处理器中实现的。AutowiredAnnotationBeanPostProcessor类图
Stella981 Stella981
3年前
Spring Cloud Eureka 全解 (5)
本文基于SpringCloudDalston.SR5(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fcloud.spring.io%2Fspringcloudstatic%2FDalston.SR5%2F)自我保护机制关闭自我保护机制(默认是打开的):eu
Wesley13 Wesley13
3年前
Eclipse中创建新的Spring Boot项目
简单几步,在Eclipse中创建一个新的spring(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Flib.csdn.net%2Fbase%2Fjavaee)Boot项目:1、Eclipse中安装STS插件:HelpEclipseMarketplace...
Stella981 Stella981
3年前
Spring Cloud Spring Boot mybatis分布式微服务云架构
简介在上一节中,我们讨论了feignhystrix在项目开发中,除了考虑正常的调用之外,负载均衡和故障转移也是关注的重点,这也是feignribbonhystrix的优势所在,本节我们就讨论一下在feign中使用ribbon,有两种方式一、通过在配置文件application.yml配置,开启ribbon,并指定调用生产者相对上
Stella981 Stella981
3年前
SpringBoot2.x搭建Eureka
1说明1.全部配置基于1.8.0_1112.当前SpringBoot使用2.0.52创建项目在SpringBoot项目生成器(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fstart.spring.io%2F)中,输入Grou
Stella981 Stella981
3年前
Spring Boot 动态数据源(Spring 注解数据源)
<divclass"contentdetailmarkdownbody"<p本文实现案例场景:<br某系统除了需要从自己的主要数据库上读取和管理数据外,还有一部分业务涉及到其他多个数据库,要求可以在任何方法上可以灵活指定具体要操作的数据库。</p<p为了在开发中以最简单的方法使用,本文基于注解和AOP的方法实现,在springbo
Stella981 Stella981
3年前
Spring5.0源码学习系列之浅谈AOP代理创建(十)
前言介绍附录:Spring源码学习专栏(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fblog.csdn.net%2Fu014427391%2Fcategory_10493299.html)在上一章节(https://www.oschina.net/action/
Stella981 Stella981
3年前
Spring3核心技术之AOP配置
在Spring配置文件中,所有AOP相关定义必须放在<aop:config标签下,该标签下可以有<aop:pointcut、<aop:advisor、<aop:aspect标签,配置顺序不可变。!(http://static.oschina.net/uploads/img/201511/25003650_G0NP.jpg)●