My best practices for operating Redis stream with redisson client in Spring Boot 3.x
- Verify FullName(stream + group + consumer_name) not blank and duplicate, when register Listener
-
com.itplh.best.practices.redisson.stream.EnhanceStreamListener
add the following extensions:- getMetaInfo()
- getStream()
- getGroup()
- getConsumerName()
- getFullName()
- getFullGroup()
- Abstract class
com.itplh.best.practices.redisson.stream.AbstractAutoRetryStreamListener
- Automatically enable the failed retry mechanism, when the stream is single consume group
- default maximum retry count: 10
- customize the override of the 'maxRetries' method
- Support successful callback
onSuccess
- Support failure callback (reaching the max retries)
onFailure
- Support finally callback
onFinally
- Automatically enable the failed retry mechanism, when the stream is single consume group
- Java 21
- Redis 5.0.10
- Spring Boot 3.2.4
- redisson-spring-boot-starter 3.27.2
- Lombok 1.18.30
- Run
com.itplh.best.practices.redisson.Application
- push data to stream
curl --location --request GET 'http://localhost:8080/redisson/stream/push-data'