This repository contains event driven redis app uses redis streams

Overview

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

HTTPie

mvn spring-boot:start

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

mvn spring-boot:stop

Manual

Create a redis stream called my_stream

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

Check what identity we have in redis

127.0.0.1:6379> KEYS *
# output:
"my_stream"

Check type of key my_stream

127.0.0.1:6379> TYPE my_stream
# output:
stream

Consume that stream

127.0.0.1:6379> 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

127.0.0.1:6379> XREAD STREAMS my_stream 1637443677304-0
# output:
(nil)

Wait by blocking for 5 seconds for a next value from a stream

127.0.0.1:6379> XREAD BLOCK 5000 STREAMS my_stream 1637443677304-0
# output:
(nil)
(5.09s)

Cleanup

docker stop redis

rtfm

You might also like...
A simple, lightweight, non-bloated redis client for kotlin and other JVM languages

rekt is a lightweight, non-bloated redis client, primarily written for the kotlin programming language, while also supporting other JVM-based languages, such as Java, Scala, and obviously way more.

A spring-boot project that demonstrates data caching using Redis

A spring-boot project that demonstrates data caching using Redis

Kreds - a thread-safe, idiomatic, coroutine based Redis client written in 100% Kotlin

Kreds Kreds is a thread-safe, idiomatic, coroutine based Redis client written in 100% Kotlin. Why Kreds? Kreds is designed to be EASY to use. Kreds ha

Spring Boot Example with Kotlin and Domain Driven Design

Spring Boot Kotlin Domain Driven Design Example Just an example project where ddd is implemented with some other great patterns and architecture from

Simple event library to communicate between Activity/Fragment and ViewModel

Setup dependencies { implementation "com.github.skgmn:viewmodelevent:1.1.0" } If you don't know how to access to GitHub Packges, please refer to

Event State Processor Generator plugin is compatible with IntelliJ and Android Studio.
Event State Processor Generator plugin is compatible with IntelliJ and Android Studio.

Event State Processor Generator plugin is compatible with IntelliJ and Android Studio. It provides source code generation for the EventStateProcessor Library to increase code productivity in Flutter apps development.

Micorservice with event sourcing sample kotlin

micorservice-with-event-sourcing-sample-kotlin Event Sourcing Exercises. Maybe it should work. Project eventsourcing Event Sourcing by Jpa or Cosmos D

Clean MVVM with eliminating the usage of context from view models by introducing hilt for DI and sealed classes for displaying Errors in views using shared flows (one time event), and Stateflow for data

Clean ViewModel with Sealed Classes Following are the purposes of this repo Showing how you can remove the need of context in ViewModels. I. By using

Explain - An application does not have a dialog box to confirm an event

Explain An application does not have a dialog box to confirm an event. This library is designed in a way that makes it easy for the developer to use a

Owner
Maksim Kostromin
Fullstack Senior Software Engineer, Team Lead in Software Company. I do cloud native Java, JS. Spring fan, Kotlin lover and Scala admirer. All we need is JVM
Maksim Kostromin
An introductory dynamics to Test Driven Development (TDD)An introductory dynamics to Test Driven Development (TDD)

tdd-demo Nesse hands-on teremos uma dinâmica introdutória a Test Driven Development (TDD), ou desenvolvimento orientado por testes. instruções 1 - Clo

Plataforma Impact 1 Jan 15, 2022
This prototype app provides a list of events to be held under an organization (school, college, club, etc.) and the users can manually set event reminders at their scheduled time so that they do not miss an event.

E-CELL NITS Sample App This prototype app provides a list of events to be held under E-Cell NIT Silchar (for example, Srijan 2.0) and the users can ma

Ritam Nath 1 Nov 7, 2021
Reia is the Redis Pubsub client that Manase uses to communicate with other modules or nodes.

from Mana Reia is a simple wrapper around Lettuce to enable easy usage of its Redis Pubsub client. This library is only intended to be used for sendin

Mana 1 Apr 29, 2022
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

Oguzhan 18 Apr 21, 2022
This repository contains RabbitMQ Protobuf starters with its usage samples for spring-rabbit and spring-cloud-starter-stream-rabbit modules

This repository contains RabbitMQ Protobuf starters with its usage samples for spring-rabbit and spring-cloud-starter-stream-rabbit modules

Maksim Kostromin 2 Nov 29, 2021
This repository contains the Android Frontend part of our project

Android_Frontend This repository contains the Android Frontend part of our project. In this part of the project many extra features could be added. Bu

null 0 Jan 11, 2022
Kafka Streams Processor to unwrap CØSMOS blocks into CØSMOS transactions

Kafka Processor CØSMOS-Block A Kafka Streams Processor to unwrap CØSMOS blocks into CØSMOS transactions. Purpose The Kafka Processor CØSMOS-Block is b

OKP4 – Open Knowledge Protocol For 4 Dec 15, 2022
The Okila server project uses the Spring boot framework and uses the Kotlin language

Okila-Server The Okila server project uses the Spring boot framework and uses the Kotlin language Format Response //The response successfully format

Nankai 1 Oct 25, 2021
Extensive Redis Pub-Sub wrapper for lettuce written in Kotlin

aware Extensive annotation-based Redis Pub-Sub wrapper for lettuce written in Kotlin. Aware was written to be a replacement for the very dated Banana

Subham 6 Dec 28, 2022