Redis learning note 10: redis as message queue

Redis can not only be used as a cache server, but also as a message queue. Its list type is inherently supported as a message queue. As shown in the figure below: Because Redis's list is implemented by using a two-way linked list, which saves the head and tail nodes, it is very fast to insert elements on both sides of the list. So you can d ...

Posted on Wed, 15 Jan 2020 01:59:04 -0800 by Clerma

SpringBoot 2.0 Actual | Chapter 21: Integrating Redis

Relevant knowledge Introduction to Redis Redis is an open source, in-memory, high-performance data storage system that can be used as a database, cache, and messaging middleware. Redis supports many types of data structures, such as string, hashes, lists, sets, sortedSets, and so on. Redis has built ...

Posted on Fri, 10 Jan 2020 17:16:18 -0800 by mountaindave

RedisUtil tool class encapsulation

Redis has a lot of data structures: string, hash, list, set, etc. but in the actual delivery, we often save the object in redis, so the key value pairs are more commonly used. Redis needs to satisfy serialization when saving objects. Due to the low efficiency of java's native serialization method, the protostaff serialization ...

Posted on Wed, 01 Jan 2020 14:02:53 -0800 by thedotproduct

Sharing redis with session

Because of the load balancing of multiple servers, when obtaining the sessionId of the client, it will be different for the first time and the second time. Because of the load balancing, there are at least two servers in your server. If the first request and the second request of the client are not the same server, the sessionId will change. To ...

Posted on Sun, 29 Dec 2019 09:04:08 -0800 by itaym02

linux redis building and testing

redis building under linux System configuration: cent os 7 redis version: 3.2.8 1. Use the command to download redis: wget http://download.redis.io/releases/redis-3.2.8.tar.gz 2. decompression tar zxvf redis-3.2.8.tar.gz 3. After decompression, enter the redis directory cd redis-3.2.8 4.make make 5. Set related configura ...

Posted on Mon, 16 Dec 2019 08:48:22 -0800 by danielle

[watermelon skin] Spring Boot 2.x Integrated Redis

Spring Boot 2 integrates Redis (1) Spring Boot 2.0.3 simple integration Redis IDEA Spring Initialzr creation project: select Redis dependency Maven dependence // There is no data for the artifactId under the dependency of spring boot version 1.5 <dependency> <groupId>org.springframework.boot</groupId& ...

Posted on Tue, 10 Dec 2019 08:23:29 -0800 by KaFF

Using Redis to realize high concurrency counter

In business requirements, counters are often used: for example, a mobile phone number is limited to send 5 SMS messages a day, an interface is limited to how many requests a minute, an interface is limited to how many calls a day, and so on. The above requirements can be easily realized by using the Incr auto increment command of Redis. For exa ...

Posted on Sun, 08 Dec 2019 10:06:36 -0800 by many_pets

Spring data redis

Basic use Dependencies and configuration rely on <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> To configure spring: redis: database: 0 host: localhost port: 6379 password: jedis: pool: max-a ...

Posted on Tue, 03 Dec 2019 12:17:53 -0800 by sparq

Maintaining kafka offset to external media in spark streaming

Take kafka offset maintenance to redis as an example. redis storage format The data structure used is string, where key is topic:partition and value is offset. For example, there are three partitions under the topic of bobo, so the key value structure is as follows: The offset of bobo:0 is x The offset of bobo:1 is y The offset of bobo:2 ...

Posted on Mon, 02 Dec 2019 13:24:58 -0800 by rhunter007

redis publish and subscribe Java code implementation

In addition to being able to cache data, Redis also implements the pub / sub message communication mode: the sender (pub) sends messages, and the subscriber (sub) receives messages. In order to implement the publish and subscribe mechanism of redis, first open the redis service; secondly, introduce the jar package required by redis, and add the ...

Posted on Sun, 01 Dec 2019 14:47:53 -0800 by rortelli