自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 springboot-rabbitmq结合源码解析

spring-boot与rabbitmq结合的源码分析

2023-02-03 17:16:37 149

原创 1:两数之和

大整数加法:public int[] twoSum(int[] nums, int target) {Map<Integer,Integer> map = new HashMap<>();int[] result = new int[2];for (int i = 0; i < nums.length; i++) {if(map.containsKey(target - nums[i])){ //需要看有没有在map中。result[0] = i;result..

2022-08-10 14:48:18 113

原创 sentinel学习(6)——源码阅读----LogSlot.entry()

这个Slot的作用主要记录日志:@Override public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode obj, int count, boolean prioritized, Object... args) throws Throwable { try { fireEntry(context, resourceWrapper, obj

2022-03-31 23:15:32 118

原创 sentinel学习(5)——源码阅读----ClusterBuilderSlot.entry()(完)

这个的作用是什么?猜测:主要是构建集群的节点,并赋值给 当前节点的属性 node.setClusterNode(clusterNode);后续有可能会用到。public void entry(Context context, ResourceWrapper resourceWrapper, DefaultNode node, int count, boolean prioritized, Object... args) throws Thro

2022-03-31 23:11:50 83

原创 记一次redis操作在SessionCallback中开启事务operations.opsForValue().get(key)获取不到值的问题

BUG代码场景:String key ="ceshi1"; String newValue = "6"; String oldValue = "7"; //这里是能取到值的 String s = redisOperator.get(key); System.out.println(s); SessionCallback<List<Object>> sessionCallback = n

2022-03-16 22:36:51 1545 1

原创 sentinel学习(3)——源码阅读----NodeSelectorSlot.entry()(完)

1:这个slot的作用是什么?public void entry(Context context, ResourceWrapper resourceWrapper, Object obj, int count, boolean prioritized, Object... args) throws Throwable { DefaultNode node = map.get(context.getName()); if (node == n

2022-02-14 20:11:37 203

原创 sentinel学习(3)——源码阅读----SentinelWebInterceptor(完)

1:看下这个类实现了哪些接口跟类。![在这里插入图片描述](https://img-blog.csdnimg.cn/7e77b9523f75478792a410e95f718b84.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBAS0NNRFk=,size_19,color_FFFFFF,t_70,g_se,x_16)关系...

2022-01-27 21:24:56 786

原创 sentinel学习(2)——源码阅读----SentinelWebAutoConfiguration

0:问题:sentinel是怎么拦截并进行限流,熔断,降级的。1:找自动配置类: 老规矩:直接搜索 spring.factories 文件,查询关键字 SentinelAuto,配置如下:com.alibaba.cloud.sentinel.SentinelWebAutoConfiguration,\com.alibaba.cloud.sentinel.SentinelWebFluxAutoConfiguration,\com.alibaba.cloud.sentinel.endpoint.S

2022-01-26 22:56:21 1304

原创 sentinel学习(1)——基础使用

sentinel源码学习1

2022-01-24 22:51:45 398

原创 gateway学习——转发的过程 源码解读(4)完

问题:访问gateway的地址:localhost:8080/spring-nacos/user/info是如何转发到 localhost:8081/spring-nacos/user/info 项目的DispatcherHandler类就是gateway的请求入口,(怎么知道这是入口,大概是:http请求——>netty线程模型,处理read事件——>然后调用DispatcherHandler.hanlder方法。这一块没去研究,百度到的)。DispatcherHandler先介绍

2022-01-11 22:35:06 828

原创 gateway学习——源码解读3——之GatewayAutoConfiguration

GatewayAutoConfiguration:先粗略熟悉一部分相关的Bean的功能,对于后续的 源码整体流程阅读 会有一定的帮助,个人习惯。/** * @author Spencer Gibb * @author Ziemowit Stolarczyk */@Configuration(proxyBeanMethods = false)@ConditionalOnProperty(name = "spring.cloud.gateway.enabled", matchIfMissing

2022-01-10 23:24:49 843

原创 gateway学习——更多配置使用解读(2)

翻译至-官方文档:https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#gateway-request-predicates-factories1:gateway的路由匹配:配置说明:spring: cloud: gateway: routes: - id: payment_routh #payment_routh #路由的ID,没有固定规则但要求唯一,简易配合服

2022-01-09 18:22:01 591

原创 gateway学习——基础使用(1)

1:gateway项目配置:pom.xml配置 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> <exclusions> <exclusion&gt

2022-01-09 17:06:41 561

转载 JAVA日志MDC追踪快速定位问题源头(转发)

https://blog.csdn.net/a183400826/article/details/101519219

2021-11-11 11:07:04 206

原创 @RefreshScope

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档文章目录前言一、@RefreshScope基础使用。二、@RefreshScope原理解析前言学习使用@RefreshScope注解,理解其原理提示:以下是本篇文章正文内容,一、@RefreshScope基础使用。基础使用方法这里不做介绍二、@RefreshScope原理解析转载该文章,写的很详细,向大佬学习http://www.jiagouc.com/refreshscope-detail/...

2021-11-10 18:56:45 296

原创 springboot整合nacos-config-源码分析3

上一篇讲了 spring-boot跟nacos-config整合的相关逻辑。(相当于前期准备工作)这里开始从springboot启动开始,看看nacos-config是怎么参与到springboot中的。springboot启动流程(只讲跟nacos-config相关的)1:SpringApplication.run()2:prepareContext该方法的applyInitializers()会去遍历ApplicationContextInitializer的实现类其中有一个类:Proper

2021-11-09 19:02:24 569

原创 springboot整合nacos-config-源码分析2

带着问题去读源码:问题1:springboot跟nacos-config是怎么整合的(主要关心:是用到了spring中的哪些扩展点)问题2:nacos-config是如何从服务器拉取配置的(怎么生成dataId,为何在application.yml中配置nacos.config的配置却无法生效)问题3:使用@RefreshScope注解以后,为什么会实时的拉取数据。1:springboot跟nacos-config的整合:整体大概思路:a:引入spring-cloud-starter-aliba

2021-11-09 15:20:23 903

原创 springboot整合nacos-config-源码分析1(基础使用)

1:springboot的整合:pom文件配置:父模块配置 <properties> <java.version>1.8</java.version> <spring-boot.version>2.2.6.RELEASE</spring-boot.version> <spring-cloud.version>Hoxton.SR9</spring-cloud.version>

2021-11-09 11:28:53 349

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除