Giter Club home page Giter Club logo

spring-reactive-cassandra-kotlin-example's Introduction

Spring Reactive Cassandra Kotlin Example

Spring Boot example with Spring Data Cassandra Reactive using Kotlin as programming language.

What is reactive streams and programming?

Reactive Streams is an initiative to provide a standard for asynchronous stream processing with non-blocking back pressure. โ€” http://www.reactive-streams.org

Reactive programming is an asynchronous programming paradigm concerned with data streams and the propagation of change. This means that it becomes possible to express static (e.g. arrays) or dynamic (e.g. event emitters) data streams with ease via the employed programming language(s). โ€” https://en.wikipedia.org/wiki/Reactive_programming

Setup

Make sure you have Cassandra running locally. You can download the distribution or use Docker:

docker run --name cassandra-db -d -p 9042:9042 cassandra

You need to create a cassandra keyspace with cqslh.

# qlsh --cqlversion=3.4.4
cqlsh> create KEYSPACE avthart with replication={'class':'SimpleStrategy', 'replication_factor':1};

You can configure the keyspace name with spring.data.cassandra.keyspace-name

Run

Start app using spring-boot maven plugin:

mvn spring-boot:run

Retrieve tasks using Server-Sent Events with httpie. The events are delayed with 500 ms because delayElements(...) is added to the Flux response, see code.

http -S :8080/tasks Accept:text/event-stream

Or retrieve as application/json:

http :8080/tasks

References

spring-reactive-cassandra-kotlin-example's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.