Skip to content

My best practices for operating Redis stream with redisson client in Spring Boot3. x

License

Notifications You must be signed in to change notification settings

tanpenggood-best-practices/spring-boot-3.x-redisson-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot 3.x Redisson Stream

My best practices for operating Redis stream with redisson client in Spring Boot 3.x

Feature

  • Verify FullName(stream + group + consumer_name) not blank and duplicate, when register Listener
  • com.itplh.best.practices.redisson.stream.EnhanceStreamListener add the following extensions:
    1. getMetaInfo()
    2. getStream()
    3. getGroup()
    4. getConsumerName()
    5. getFullName()
    6. getFullGroup()
  • Abstract class com.itplh.best.practices.redisson.stream.AbstractAutoRetryStreamListener
    1. Automatically enable the failed retry mechanism, when the stream is single consume group
      1. default maximum retry count: 10
      2. customize the override of the 'maxRetries' method
    2. Support successful callback onSuccess
    3. Support failure callback (reaching the max retries) onFailure
    4. Support finally callback onFinally

Development Environment

  • Java 21
  • Redis 5.0.10
  • Spring Boot 3.2.4
  • redisson-spring-boot-starter 3.27.2
  • Lombok 1.18.30

Sample

  1. Run com.itplh.best.practices.redisson.Application
  2. push data to stream
    curl --location --request GET 'http://localhost:8080/redisson/stream/push-data'

Docs

Redis Stream - Best Practices

Should XDEL be executed after XACK ?

About

My best practices for operating Redis stream with redisson client in Spring Boot3. x

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages