• Stars
    star
    235
  • Rank 171,079 (Top 4 %)
  • Language
    Java
  • License
    MIT License
  • Created almost 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reactive (RSocket/gRPC) Gateway for the event-based systems

Liiklus

Liiklus [li:klus] ("traffic" in Estonian) - RSocket/gRPC-based Gateway for the event-based systems from the ones who think that Kafka is too low-level.

Why

  • horizontally scalable RSocket/gRPC streaming gateway
  • supports as many client languages as RSocket+gRPC do (Java, Go, C++, Python, etc...)
  • reactive first
  • Per-partition backpressure-aware sources
  • at-least-once/at-most-once delivery guarantees
  • pluggable event storage (Kafka, Pulsar, Kinesis, etc...)
  • pluggable positions storage (DynamoDB, Cassandra, Redis, etc...)
  • WIP: cold event storage support (S3, Minio, SQL, key/value, etc...)

Who is using

  • https://vivy.com/ - 25+ microservices, an abstraction in front of Kafka for the Shared Log Infrastructure (Event Sourcing / CQRS)

Quick Start

The easiest (and recommended) way to run Liiklus is with Docker:

$ docker run \
    -e kafka_bootstrapServers=some.kafka.host:9092 \
    -e storage_positions_type=MEMORY \ # only for testing, DO NOT use in production
    -p 6565:6565 \
    bsideup/liiklus:$LATEST_VERSION

Where the latest version is:

Now use LiiklusService.proto to generate your client.

The clients must implement the following algorithm:

  1. Subscribe to the assignments:
    stub.subscribe(SubscribeRequest(
        topic="your-topic",
        group="your-consumer-group",
        [autoOffsetReset="earliest|latest"]
    ))
    
  2. For every emitted reply of Subscribe, using the same channel, subscribe to the records:
    stub.receive(ReceiveRequest(
        assignment=reply.getAssignment()
    ))
    
  3. ACK records
    stub.ack(AckRequest(
        assignment=reply.getAssignment(),
        offset=record.getOffset()
    ))
    
    Note 1: If you ACK record before processing it you get at-most-once, after processing - at-least-once
    Note 2: It's recommended to ACK every n-th record, or every n seconds to reduce the load on the positions storage

Java example:

Example code using Project Reactor and reactive-grpc:

var stub = ReactorLiiklusServiceGrpc.newReactorStub(channel);
stub
    .subscribe(
        SubscribeRequest.newBuilder()
            .setTopic("user-events")
            .setGroup("analytics")
            .setAutoOffsetReset(AutoOffsetReset.EARLIEST)
            .build()
    )
    .flatMap(reply -> stub
        .receive(ReceiveRequest.newBuilder().setAssignment(reply.getAssignment()).build())
        .window(1000) // ACK every 1000th records
        .concatMap(
            batch -> batch
                .map(ReceiveReply::getRecord)
                // TODO process instead of Mono.delay(), i.e. by indexing to ElasticSearch
                .concatMap(record -> Mono.delay(Duration.ofMillis(100)))
                .sample(Duration.ofSeconds(5)) // ACK every 5 seconds
                .onBackpressureLatest()
                .delayUntil(record -> stub.ack(
                    AckRequest.newBuilder()
                        .setAssignment(reply.getAssignment())
                        .setOffset(record.getOffset())
                        .build()
                )),
            1
        )
    )
    .blockLast()

Also check examples/java/ for a complete example

Configuration

The project is based on Spring Boot and uses it's configuration system
Please check application.yml for the available configuration keys.

License

See LICENSE.

More Repositories

1

jabel

Jabel - unlock Javac 9+ syntax when targeting Java 8
Java
800
star
2

configo

12factor apps configuration manager
Go
170
star
3

rx-connect

Glue your state and pure React components with RxJS
JavaScript
85
star
4

forward2docker

Utility to auto forward a port from localhost into ports on Docker containers running in a boot2docker or Docker Machine VM
Go
77
star
5

graphql-java-reactive

Reactive GraphQL execution strategy
Java
54
star
6

MacroGroovy

Groovy
41
star
7

IDEA-GitLab-Integration

Java
32
star
8

spring-boot-thrift

Java
29
star
9

tinsalver

Maven Central release helper to keep your private keys private
JavaScript
26
star
10

groovy-macro-methods

Java
16
star
11

gradle-maven-sync-plugin

Sync your Gradle build with the dependencies from pom.xml
Java
14
star
12

thrift-spring-boot-starter

Java
12
star
13

TLSignals

Signals for objective-c
Objective-C
12
star
14

groovy-pattern-match

Java
11
star
15

redis-maven-plugin

Embedded pure Java redis server for maven
Java
10
star
16

groovy-macro-methods-proposal

Apache Groovy proposal of macro methods implementation
9
star
17

spring-io-testcontainers-workshop

Java
9
star
18

GradleThrift

Groovy
8
star
19

Graxe

Groovy
8
star
20

macro-methods-workshop

Groovy
8
star
21

testcontainers-microservices-example

Java
8
star
22

javaagent-boilerplate

Java
7
star
23

testing-docker-images-with-testcontainers

Groovy
6
star
24

GOM

Groovy Object Mapper
Groovy
6
star
25

blog-custom-Jackson-annotations

https://bsideup.github.io/posts/custom_jackson_annotations/
Java
6
star
26

docker-call

Go
6
star
27

querydsl-gradle-idea

http://bsideup.blogspot.com/2015/04/querydsl-with-gradle-and-idea.html
Java
5
star
28

Vaadlin

Kotlin static DSL for Vaadin
Kotlin
5
star
29

spring-boot-sample-papertrail

Java
5
star
30

TrylogicFramework

flex-like (non flex-based) ActionScript framework for web development (games, social, etc)
ActionScript
4
star
31

AFQuickLookView

AFNetworking Extension for document previews of remote files
Objective-C
3
star
32

concourse-build-env

Dockerfile
2
star
33

healthy-cloud-demo

Healthy cloud for a HealthTech company - AWS Berlin meetup
Python
2
star
34

spring-boot-swift

Java
2
star
35

grpc-bidi

Java
2
star
36

bsideup.github.io

HTML
1
star
37

groovyastconsole

Groovy
1
star
38

TLBindings

Objective-c framework for bindings
Objective-C
1
star
39

OSSRH-60599

1
star
40

TrylogicUtils

Trylogic utils for TrylogicFramework
ActionScript
1
star
41

ecs-drainer

1
star
42

zero-to-cloud-demo

Ruby
1
star
43

TrylogicSignals

Signals for Java
Java
1
star
44

TestFlight-deployer

simple ant script to for deploying your *.ipa to TestFlight
1
star
45

IvyHelper

1
star
46

TLDropDownMenu

Drop down menu category from UINavigationBar for UINavigationController
Objective-C
1
star
47

flexmojos-create-rsl-maven-plugin

RSL creator for FlexMojos 5.*
Java
1
star
48

jmh-async-profiler

1
star
49

JUnitReportPrinter

ant task for printing junitreport's output in readable format (use it with flexunit)
1
star