自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 资源 (1)
  • 收藏
  • 关注

原创 shardingJDBC配置-java多数据源分表

直接上代码pom文件配置<!-- jdbc --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> <exclusions> &lt

2022-05-17 15:27:34 819

原创 java使用redis接口访问频率限制

本文使用AOP与redis进行接口的访问频率限制,两个功能,可以限制两次接口访问间隔时间与几分钟内访问几次,比如,某接口3分钟内同一用户不能超过10次,并且两次访问间隔不能低于10S。废话不多说,上代码。@Target(ElementType.METHOD)@Retention(RetentionPolicy.RUNTIME)@Documented/** * one minutes request frequency is Fifty times, exceeding the wait fiv

2021-12-21 14:35:29 3307

原创 RabbitMq延时队列-死信方式处理延时任务

##队列绑定import org.springframework.amqp.core.*;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import java.util.HashMap;import java.util.Map;@Configurationpublic class RabbitMqConfig {

2020-08-20 20:07:52 216

原创 springBoot,使用jedis操作lua脚本实现分布式锁,兼容redis单点、集群、哨兵模式连接

@Configuration@ConditionalOnClass({GenericObjectPool.class})@Slf4jpublic class RedisConfig{ @Autowired RedisProperties redisProperties; @Value("${spring.redis.strategy}") private String strategy; @Bean public JedisSentinelPool j.

2020-08-19 11:07:30 404

原创 SpringBoot连接redis,支持单点、集群、哨兵模式自适应配置(二、redissonClient)

@Autowired RedisProperties redisProperties; /** * 哨兵模式自动装配 * * @return */ @Bean(destroyMethod = "shutdown") @ConditionalOnProperty(name="spring.redis.strategy", havingValue = "3") public RedissonClient redisson...

2020-08-19 10:54:19 2169

原创 SpringBoot连接redis,支持单点、集群、哨兵模式自适应配置(一、redisTemplate)

可以根据配置相应策略切换redis的模式@Autowired RedisProperties redisProperties; @Autowired @Value("${spring.redis.strategy}") private String strategy; /** * 连接池配置信息 */ @Bean public JedisPoolConfig jedisPoolConfig() { JedisP

2020-08-19 10:51:50 1520

原创 List的日期排序Collections.sort()

package test;import java.util.ArrayList;import java.util.Calendar;import java.util.Collections;import java.util.Date;import java.util.List;public class Test { public static void main(String[...

2019-09-19 16:49:29 999

转载 多个图片链接打包成zip

public void download(HttpServletRequest request, HttpServletResponse response){ try { String downloadFilename = "中文.zip";//文件的名称 downloadFilename = UR...

2019-05-22 14:03:26 819

转载 spring MVC rmi配置

1.生产者配置<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.spring...

2019-04-16 11:21:44 305

转载 spring MVC dubbo 生产者和消费者配置

1.生产者配置<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:contex...

2019-04-16 11:00:45 983

转载 spring事务回滚相关

事务的作用就是为了保证用户的每一个操作都是可靠的,事务中的每一步操作都必须成功执行,只要有发生异常就回退到事务开始未进行操作的状态。 在实际项目中,使用事务是很简单的,在 Spring 项目中,一个 @Transactional 注解就可以解决。 1. 异常并没有被 “捕获” 到 这是个很常见的小坑,异常并没有被 “捕获” 到,导致事务并没有回滚。我们在业务层代码中,也许已...

2018-11-29 14:12:35 198

省市区街道四级地址信息库

省市区街道四级地址信息库

2021-12-23

空空如也

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

TA关注的人

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