- 博客(7)
- 收藏
- 关注
原创 手写Ribbon负载均衡算法
手写ribbon负载均衡算法通过分析Ribbon负载均衡源码(RoundRobinRule.class),自己手写Ribbon负载均衡算法实现从eureka看到有两个serviceInstanceSPRINGCLOUD-ORDER (服务消费者)SPRINGCLOUD-PAYMENT(服务提供者—集群,目前是8001和8002两个)自定义接口类MyLoadBalance返回URIpublic interface MyLoadBalance { public URI getServ
2020-12-21 22:47:15 314 1
原创 FastDFS文件服务器搭建
FastDFS1.下载1.libfastcommon安装包https://github.com/happyfish100/libfastcommon/archive/V1.0.43.tar.gz2.fastdfs安装包https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz3.fastdfs-nginx-module安装包https://github.com/happyfish100/fastdfs-ngin
2020-12-05 21:36:10 146
原创 springboot使用RabbitMQ的fanout广播模式消费者死活接收不到消息
1.application.yml文件server: port: 8002spring: application: name: producer rabbitmq: host: 192.168.1.5 port: 5672 virtual-host: rabbitmq-test username: hang_yang password: hang_yang2.生产者@Test public void sendMessageFan.
2020-12-02 07:10:12 2353 3
原创 JDK1.8新特性
JDK1.8新特性函数式接口定义:就是一个有且仅有一个抽象方法,但是可以有多个非抽象方法的接口。使用:在接口上面使用@FunctionalInterface注解表明该接口是一个函数式接口示例@FunctionalInterfacepublic interface TestService { void test01();}如果写两个接口则报错[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bthaHw6R-1604480076350)(C:\
2020-11-04 16:55:27 105
原创 springboot第一次在项目中使用的整理和反思
springboot1.@SpringBootApplication注解2.springboot集成freemarker3.springboot多数据源配置 3.1多数据源事务问题4. 全局异常捕获5.springboot定时任务调度框架 5.1.spring3.0版本之后自带任务调度框架springtask1.@SpringBootApplication注解@SpringBootApplication =@SpringBootConfiguration + @EnableAutoC
2020-11-04 09:18:27 188
原创 springboot自定义springbootstart,测试读取application.yml文自定义属性的内容
springboot自定义springbootstart1.前言本文主要是介绍springboot如何创建springboot start,并且引入dependency使用主要是通过读取配置文件的内容,并且使idea写我们自定的配置文件时有提示,自动补全功能,更容易去理解springboot start封装的内容2.创建springboot start2.1.新建项目read-properties-springboot-start1.在pom.xml引入springboot依赖的paren
2020-11-03 23:07:15 594 2
原创 基于springboot自定义事务注解
基于springboot自定义事务注解1.开启注解支持(springboot默认支持注解)2.自定义注解接口3.写事务类4.写切面类2.自定义注解接口import java.lang.annotation.*;/** * 注解类 */@Target(ElementType.METHOD) //定义注解用在方法上@Retention(RetentionPolicy.RUNTIME) //运行时注解@Documentedpublic @int
2020-10-28 12:16:15 2239 4
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人