Spring Boot Redis Streams CI

This repository contains event driven redis app uses redis streams

Run redis in docker

docker run --rm --name redis -itp6379:6379 redis:6.2.6-alpine


mvn spring-boot:start

http --stream :8080 &
http :8080 body=Hello
http :8080 body=World

mvn spring-boot:stop


Create a redis stream called my_stream

docker exec -it redis redis-cli> XADD my_stream * value "Hello, World!"
# output: identity, which is message id:

Check what identity we have in redis> KEYS *
# output:

Check type of key my_stream> TYPE my_stream
# output:

Consume that stream> XREAD STREAMS my_stream 0
# output:
1) 1) "my_stream"
   2) 1) 1) "1637443677304-0"
         2) 1) "value"
            2) "Hello, World!"

Continue read stream from a last message I get> XREAD STREAMS my_stream 1637443677304-0
# output:

Wait by blocking for 5 seconds for a next value from a stream> XREAD BLOCK 5000 STREAMS my_stream 1637443677304-0
# output:


docker stop redis



View Github