WellJay / Spring Data Redis Tools
Licence: mit
🔒spring data redis 封装工具类包含分布式锁(distributedLock)、分布式唯一键(distributedId)
Stars: ✭ 43
Programming Languages
java
68154 projects - #9 most used programming language
Labels
Projects that are alternatives of or similar to Spring Data Redis Tools
Gympoint Api
Rest API of a gym management application - built with Express, Postgres, Redis, and Nodemailer.
Stars: ✭ 39 (-9.3%)
Mutual labels: redis
Djforge Redis Multitokens
Django Rest Framework Redis MultiTokens
Stars: ✭ 40 (-6.98%)
Mutual labels: redis
Docker Redis Cluster
Running a distributed 6-node Redis Cluster with Docker Swarm, Docker Compose, and Supervisor
Stars: ✭ 39 (-9.3%)
Mutual labels: redis
Freelancers Market
Laravel Project to help freelance websites clients and freelancers to find each other.
Stars: ✭ 39 (-9.3%)
Mutual labels: redis
Fastonosql
FastoNoSQL is a crossplatform Redis, Memcached, SSDB, LevelDB, RocksDB, UnQLite, LMDB, ForestDB, Pika, Dynomite, KeyDB GUI management tool.
Stars: ✭ 1,001 (+2227.91%)
Mutual labels: redis
Drupal Nginx Php Kubernetes
Demonstration of a set of NGINX and PHP-FPM containers running Drupal deployed to Kubernetes on the IBM Container Service. This is a work in progress.
Stars: ✭ 43 (+0%)
Mutual labels: redis
Kuzzle
Open-source Back-end, self-hostable & ready to use - Real-time, storage, advanced search - Web, Apps, Mobile, IoT -
Stars: ✭ 991 (+2204.65%)
Mutual labels: redis
Nagios Plugins
450+ AWS, Hadoop, Cloud, Kafka, Docker, Elasticsearch, RabbitMQ, Redis, HBase, Solr, Cassandra, ZooKeeper, HDFS, Yarn, Hive, Presto, Drill, Impala, Consul, Spark, Jenkins, Travis CI, Git, MySQL, Linux, DNS, Whois, SSL Certs, Yum Security Updates, Kubernetes, Cloudera etc...
Stars: ✭ 1,000 (+2225.58%)
Mutual labels: redis
Reading And Comprehense Twemproxy0.4.1
redis、memcached缓存代理twemproxy源码详细分析注释,带详尽中文注释及函数调用关系。(源码学习交流QQ群:568892619)
Stars: ✭ 39 (-9.3%)
Mutual labels: redis
Findme
serverless application to find unlabelled photos of you on twitter using machine learning (tensorflow.js).
Stars: ✭ 43 (+0%)
Mutual labels: redis
Connection Pool Client
💥 A simple multi-purpose connection pool client (Kafka & Hbase & Redis & RMDB & Socket & Http)
Stars: ✭ 40 (-6.98%)
Mutual labels: redis
Phalcon Vm
Vagrant configuration for PHP7, Phalcon 3.x and Zephir development.
Stars: ✭ 43 (+0%)
Mutual labels: redis
Blackwidow
A library implements REDIS commands(Strings, Hashes, Lists, Sorted Sets, Sets, Keys, HyperLogLog) based on rocksdb
Stars: ✭ 43 (+0%)
Mutual labels: redis
Pantry
🥑 Free data storage as a service that allows devs to store JSON for multiple apps & users. A good resource when building personal projects, apps for hackathons, and prototypes alike.
Stars: ✭ 42 (-2.33%)
Mutual labels: redis
spring-data-redis-tools
- RedisTemplate封装工具类
redisTools
- 可视化分布式ID生成器
distributedId
- 可靠分布式锁工具类
distributedLock
(lua脚本实现原子性解决断电问题、valueId避免错误释放问题) - Redis技术总结思维导图
Maven
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
RedisConfiguration
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import redis.clients.jedis.JedisPoolConfig;
/**
* @author wellJay
*/
@Configuration
@EnableCaching
public class RedisConfiguration {
//过期时间一天
private static final int DEFAULT_EXPIRE_TIME = 3600 * 24;
//从配置文件读取redis参数
@Autowired
private CloudConfigProperties cloudConfigProperties;
/**
* jedisPoolConfig config
*/
@Bean
public JedisPoolConfig jedisPoolConfig() {
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
jedisPoolConfig.setMaxIdle(cloudConfigProperties.getRedis().getMaxIdle());
jedisPoolConfig.setMinIdle(cloudConfigProperties.getRedis().getMinIdle());
jedisPoolConfig.setTestOnBorrow(cloudConfigProperties.getRedis().getTestOnBorrow());
jedisPoolConfig.setTestOnReturn(cloudConfigProperties.getRedis().getTestOnReturn());
return jedisPoolConfig;
}
/**
* JedisConnectionFactory
*/
@Bean
public JedisConnectionFactory jedisConnectionFactory(JedisPoolConfig jedisPoolConfig) {
JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();
jedisConnectionFactory.setHostName(cloudConfigProperties.getRedis().getHost());
jedisConnectionFactory.setPort(cloudConfigProperties.getRedis().getPort());
jedisConnectionFactory.setPassword(cloudConfigProperties.getRedis().getPassword());
jedisConnectionFactory.setTimeout(cloudConfigProperties.getRedis().getTimeout());
jedisConnectionFactory.setUsePool(true);
jedisConnectionFactory.setPoolConfig(jedisPoolConfig);
return jedisConnectionFactory;
}
/**
* RedisTemplate
* 从执行时间上来看,JdkSerializationRedisSerializer是最高效的(毕竟是JDK原生的),但是是序列化的结果字符串是最长的。
* JSON由于其数据格式的紧凑性,序列化的长度是最小的,时间比前者要多一些。
* 所以个人的选择是倾向使用JacksonJsonRedisSerializer作为POJO的序列器。
*/
@Bean
public RedisTemplate redisTemplate(JedisConnectionFactory jedisConnectionFactory) {
RedisTemplate<?, ?> redisTemplate = new RedisTemplate();
redisTemplate.setConnectionFactory(jedisConnectionFactory);
redisTemplate.setDefaultSerializer(new StringRedisSerializer());
//设置普通value序列化方式
redisTemplate.setValueSerializer(new StringRedisSerializer());
redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
return redisTemplate;
}
@Bean
public CacheManager cacheManager(RedisTemplate redisTemplate) {
RedisCacheManager redisCacheManager = new RedisCacheManager(redisTemplate);
redisCacheManager.setDefaultExpiration(DEFAULT_EXPIRE_TIME);
return redisCacheManager;
}
}
How To Use
1、注入util方式,适用于复杂的业务处理
@Autowired
private RedisCacheUtil redisCacheUtil;
2、Spring注解方式适用于简单的数据缓存
@Cacheable(value = Constants.RedisKey.XXX_KEY)
Redis技术总结
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].