- 博客(71)
- 资源 (6)
- 收藏
- 关注

原创 java volatile 废话不多说,来看代码
public class VolatileTest{ private static int MY_INT = 0; public static void main(String[] args) { new ChangeListener().start(); new ChangeMaker().start(); } static...
2019-02-21 20:34:14
232
转载 mysql中case when的用法
https://blog.youkuaiyun.com/jiayi_yao/article/details/124529659
2022-11-09 13:14:52
127
原创 Controller入参注解校验
@Validate是@valid的增强版本可以分组校验如下。1.对象中嵌套对象校验 需要在嵌套对象上加 @Valid注解。
2022-09-20 14:31:26
265
转载 为什么要用分布式事务
假如某个时刻,redis里面的某个商品库存为1,此时两个请求同时到来,其中一个请求执行到上图的第3步,更新数据库的库存为0,但是第4步还没有执行。因为上图中的两个A系统,运行在两个不同的JVM里面,他们加的锁只对属于自己JVM里面的线程有效,对于其他JVM的线程是无效的。的获取锁的“东西”,然后每个系统在需要加锁时,都去问这个“东西”拿到一把锁,这样不同的系统拿到的就可以认为是同一把锁。假设此时两个用户的请求同时到来,但是落在了不同的机器上,那么这两个请求是可以同时执行了,还是会出现库存超卖的问题。...
2022-08-26 11:14:42
278
原创 springCloud集成sentinel(二)使用dashboard流量限制
springCloud集成sentinel(二)使用dashboard流量限制
2022-06-04 08:39:52
534
原创 react+ajax+material-ui 实现简单table
import React from 'react';import $ from 'jquery';import Table from '@mui/material/Table';import TableBody from '@mui/material/TableBody';import TableCell from '@mui/material/TableCell';import TableContainer from '@mui/material/TableContainer';import.
2022-05-25 12:30:00
329
原创 fluent 踩坑系列无法输出到elasticsearch
Since out_elasticsearch has been included in the standard distribution of td-agent since v3.0.1, td-agent users do not need to install it manually.If you have installed Fluentd without td-agent, please install this plugin using fluent-gem:
2022-05-18 10:27:42
475
原创 fluentd实现从http中读取数据到一个文件中配置文件
配置文件 td-agent.conf<source> @type http port 9880 bind 0.0.0.0 body_size_limit 32m keepalive_timeout 10s</source><match *> @type file path E:\aaa </match>curl -X POST -d 'json={"foo":"bar"}' http://localho...
2022-05-17 20:55:04
222
原创 springboot + promethoes+grafana
springboot项目需要配置项目 1.pom依赖包 2.yml或者properties文件中配置 3.启动文件中加入检查1.pom依赖包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId>
2022-05-16 21:10:32
454
原创 zipkin链路追踪自己的Springboot项目
需要启动两个项目: 1.zipkin项目zipkin-server 2.需要监控springboot项目 productservicezipkin-server需要配置的文件有POM 文件 启动文件加上注解@EnableZipkinServer 修改application.properties<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xm.
2022-05-16 18:48:04
200
原创 log4j2配合ELK第二步,下载logstash并编写启动文件
编写logstash-to-es.conf文件input { tcp { host => "127.0.0.1" port => 4560 codec => json { charset => "UTF-8" } }}filter { json { source => "message" }}output { elasticsearch { hosts => ["localho
2022-05-15 17:03:57
397
原创 log4j2配合ELK第一步,将日志JSON化
<?xml version="1.0" encoding="UTF-8"?><Configuration><!-- <Property name="PATTERN">{"logger": "%logger", "level": "%level", "msg": "%message"}%n</Property> --> <Properties> <Property name="PID">????&.
2022-05-15 13:02:45
481
原创 git geting-start 使用手册
命令行指引你还可以按照以下说明从计算机中上传现有文件。Git 全局设置git config --global user.name "MenBad"git config --global user.email "stonegkk@gmail.com"创建一个新仓库git clone https://gitcode.net/MenBad/1.gitcd 1touch README.mdgit add README.mdgit commit -m "add README"gi
2022-05-14 11:07:38
143
原创 html5 SSE后端向前端推送实时数据
前端在src/main/resources/static/home.html 路径下建立一个home.html文件代码是是这样的<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title></head><body><h1>获取服务端更新数据</h1><
2022-05-04 15:42:39
1293
原创 POI hello
package com.example.excelgenera.controller;import org.apache.poi.xwpf.usermodel.XWPFDocument;import org.apache.poi.xwpf.usermodel.XWPFParagraph;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation..
2022-04-16 18:52:35
480
原创 前端防抖函数
function debounce (fn,delay){ let timer; return function (...args){ if(timer){ clearTimeout(timer) } timer = setTimeout(()=>{ fn.apply(this,args) .
2022-04-07 18:17:32
1303
原创 idea启动项目发现端口一直被占用,但是没有进程在使用该端口
发现其实是这些端口有可能是被 Hyper-V 保留了而我的确实是 Hyper-V 已经开启了win+R 输入cmd 打开dos命令框。按照其步骤、使用以下指令:netsh interface ipv4 show excludedportrange protocol=tcp既然找到了问题所在,那么最简单的解决方案现在有两种关闭Hyper-V 选择上面之外的其他端口;...
2022-04-05 14:12:05
3172
3
原创 idea中debug技巧
如果想要debug进入println方法直接点击两下 step Into效果如下如果想要进入add方法点击 Force step Into
2022-04-01 09:13:45
152
原创 如何看一个报错异常
package com.example.demo.utils;public class Test { public void add (int i){ System.out.println("add"); divide(i); } public void divide(int i){ System.out.println("divide"); multiply(i); } public void.
2022-03-31 18:35:18
235
原创 前后端时间传第
Controller@RequestMapping("/hi")public User index(@RequestBody User req){ DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); System.out.println(dateTimeFormatter.format(req.getBirthDate())); User resp.
2021-05-24 15:47:25
101
转载 2021-04-25
package com.nnmzkj.common.dto;import lombok.Data;import java.io.Serializable;import java.util.ArrayList;import java.util.List;@Datapublic class TreeParamDto implements Serializable { private static final long serialVersionUID = -769226610628.
2021-04-25 19:38:20
96
原创 JAVA SPI技术
SPI技术Demo配置文件META-INF/services文件名字:com.journaldev.serviceproviders.MessageServiceProvider文件内容com.journaldev.serviceproviders.EmailServiceProvidercom.journaldev.serviceproviders.PushNotificationServiceProvidermain方法测试类内容ServiceLoader<.
2021-02-01 14:27:51
124
原创 通过抛异常来暂停一个线程
package test;import java.util.concurrent.TimeUnit;public class A implements Runnable { private int tickets = 100; @Override public void run() { while (true) synchronized (this) { if (tickets > 0) { .
2021-01-01 12:34:05
140
原创 k8s镜像包下载
1.下载所需镜像链接:https://pan.baidu.com/s/10Qangf89xCMTe2NUATltNA提取码:1234
2020-12-17 13:51:59
1514
H2-JPA-SPRINGBOOT.zip
2022-06-26
程序员 分页,返回值,基础异常封装
2022-05-23
prometheus+grafana 监控服务相关
2022-05-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人