Scala library for Reactive streaming Microservices, CQRS, Event Sourcing, Event Logging, & message-driven apps.
Alternatives To Dendrites
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Awesome Serverless7,136
5 days ago2gpl-3.0
:cloud: A curated list of awesome services, solutions and resources for serverless / nobackend applications.
Event Sourcing Examples2,646
2 years ago25otherJavaScript
Example code for my building and deploying microservices with event sourcing, CQRS and Docker presentation
Php Ddd Example2,614
a month ago66PHP
🐘🎯 Hexagonal Architecture + DDD + CQRS in PHP using Symfony 6
Ultimate Backend2,141
3 months ago59mitTypeScript
Multi tenant SaaS starter kit with cqrs graphql microservice architecture, apollo federation, event source and authentication
Dotnetcore Microservices Poc1,735
11 days ago6apache-2.0C#
Very simplified insurance sales system made in a microservices architecture using .NET Core
6 days ago25C#
Full-stack .Net 7 Clean Architecture (Microservices + Dapr, Modular Monolith, Monolith), Blazor, Angular 15, React 18, Vue 3, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, Identity Server, Entity Framework Core, Selenium, SignalR, Hosted Services, Health Checks, Rate Limiting, Cloud (Azure, AWS) Services, ...
20 hours ago320apache-2.0Java
EventMesh is a new generation serverless event middleware for building distributed event-driven applications.
Clean Architecture Dotnet997
a month ago12mitC#
🕸 Yet Another .NET Clean Architecture, but for Microservices project. It uses Minimal Clean Architecture with DDD-lite, CQRS-lite, and just enough Cloud-native patterns apply on the simple eCommerce sample and run on Tye with Dapr extension 🍻
Pitstop9751125 days ago20January 23, 20221apache-2.0JavaScript
This repo contains a sample application based on a Garage Management System for Pitstop - a fictitious garage. The primary goal of this sample is to demonstrate several software-architecture concepts like: Microservices, CQRS, Event Sourcing, Domain Driven Design (DDD), Eventual Consistency.
153 years ago5September 22, 20183apache-2.0Java
Domain-Driven-Design Pub/Sub Domain-Events framework
Alternatives To Dendrites
Select To Compare

Alternative Project Comparisons



Streaming components in Scala for building Microservices, Event Sourcing, Event Logging, CQRS, and Reactive systems. Functions and pre-built stream stages for Akka Streams, HTTP, Actors, Kafka, Cassandra, Algebird, and Avro. The ACK in a SMACK stack

It's meant to be used as

  • a more adaptable alternative to frameworks and products
  • examples for learning how to use these components and work with streams
  • templates for other components or custom alternatives
  • is in your product

This Readme covers download, setup and configuration, unit and integration testing and adding it to your project. Documentation is on the website, Scaladocs have examples and lower level descriptions.

Add dendrites to your project

Download from Maven Central



Add dependency in build.sbt

libraryDependencies += "com.github.garyaiki" % "dendrites_2.12" % "0.6.3"


Add dependency in pom.xml

`<!-- -->

Build from source

Requires Java 8 download jdk8 and Scala 2.12 download scala. Clone or download dendrites from Github, see cloning-a-repository

Build and test with sbt

sbt version, download, documentation

sbt commands

In a terminal window cd to the dendrites directory.

$ sbt launch sbt, returns > prompt

> help list available help

> update Resolves and optionally retrieves dependencies.

> clean Deletes files produced by the build under target directory

> compile Compiles sources under src/main/scala

> test:compile Compiles unit test sources under src/test/scala

> it:compile Compiles integration test sources under src/it/scala

> test Executes unit tests.

> testOnly Executes specific unit tests

> testQuick Re-executes failed unit tests

> package Produces the jar.

> doc Generates Scaladocs in /dendrites/target/scala-2.12/api

> scalastyle Run scalastyle on source code under src/main/scala

> test:scalastyle Run scalastyle on source code under src/test/scala

> dependencyTree Prints an ascii tree of all the dependencies to the console

> exit quit sbt

Build and test with Maven


Maven commands

In a terminal window cd to the dendrites directory.

$ mvn dependency:resolve Resolves and optionally retrieves dependencies.

$ mvn clean Deletes files produced by the build under target directory

$ mvn compile Compiles sources under src/main/scala

$ mvn scala:testCompile Compiles unit test sources under src/test/scala

$ mvn test Executes unit tests.

$ mvn install Install the package in local repository, for use as in other projects locally.

$ mvn source:jar Bundle the main sources of the project into a jar archive.

$ mvn scala:doc-jar Generate Scaladocs in a jar


Minimal install and configure for running dendrites integration tests. Kafka's documentation, download Kafka

Extract server files tar -xvf kafka_2.12-1.0.*.*.tar

Optionally, create or replace symbolic link ln -nsf kafka_2.12-1.0.*.* kafka

Configure server

Edit configuration in install directory /config/

Optional settings for development

To advertise the broker in a local install. In Socket Server Settings add listeners=PLAINTEXT://localhost:9092

In production, log retention hours are 168 (1 week). For development you can shorten them to 1. In Log Retention Policy


Install Kafka Java Driver

Add dependencies to driver jars. sbt and Maven dependency settings. See kafka-clients Maven repository page

Configure driver's Kafka Consumer

Put a Consumer Config properties file on your classpath. See Kafka's New Consumer Configs documentation and a dendrites example. KafkaSource requires for stream backpressure to control commit. To pass this configuration to KafkaSource, create a subclass of ConsumerConfig. example

Configure driver's Kafka Producer

Put a Producer Config properties file on your classpath. See Kafka's Producer Configs documentation example To pass this configuration to KafkaSink, create a subclass of ProducerConfig example

Run Kafka server

In a Terminal window cd to kafka install directory

Start Zookeeper

bin/ config/

Zookeeper will run in the foreground

Start Kafka server

In a 2nd Terminal window in the same directory

bin/ config/

Kafka server will run in the foreground

Create topic for 1 partition

In a 3rd Terminal window in the same directory

bin/ --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic account-topic

This takes a few seconds.

Run integration tests

Kafka server must be running and have an account-topic

In dendrites directory terminal window with sbt running

> it:compile

> it:testOnly com.github.garyaiki.dendrites.kafka.KafkaProducerConsumerSpec

> it:testOnly com.github.garyaiki.dendrites.kafka.AvroKafkaProducerConsumerSpec

> it:testOnly

Note: KafkaStreamSpec, ShoppingCartCmdSpec creates KafkaConsumer in KafkaSource. KafkaConsumer calls must all be from the same thread. KafkaSource doesn't close KafkaConsumer until the stream it's in completes. To re-run one of these tests, exit and restart sbt.

After tests, delete topic

List topics

bin/ --zookeeper localhost:2181 --list

Delete topic, this may not happen right away. The topic _consumerOffsets can't be deleted from the command line. Kafka Tool is a GUI tool and free for personal use.

bin/ --delete --zookeeper localhost:2181 --topic account-topic

ShoppingCartCmd integration tests
Create a topic for 1 partition

bin/ --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic shoppingcartcmd-topic

it:testOnly com.github.garyaiki.dendrites.examples.cqrs.shoppingcart.ShoppingCartCmdSpec

After tests, delete topic

bin/ --delete --zookeeper localhost:2181 --topic shoppingcartcmd-topic

After all tests, stop Kafka server, stop Zookeeper

After topic deleted, stop Kafka server


Give Zookeeper a few seconds. Then stop it too



Minimal install and configure for running dendrites integration tests, Cassandra's documentation, download Cassandra

Extract files tar -xvf apache-cassandra-3.11.*-bin.tar

Optionally, create or replace symbolic link ln -nsf apache-cassandra-3.11.* cassandra


For development, default configuration can be used.

Install Cassandra Java Driver

Add dependencies to cassandra-driver-core, cassandra-driver-mapping, cassandra-driver-extras. Driver jars with sbt and Maven dependency settings. See Datastax Cassandra Maven repository page

Configure Cassandra Client

dendrites has an example Cassandra configuration in resource.conf under dendrites/cassandra. You can override these in your application.conf file. CassandraConfig is a trait you can extend. PlayListSongConfig is an example.

Run Cassandra

In a Terminal window cd to cassandra install directory

bin/cassandra -f

It will run in the foreground

Run integration tests

In a dendrites directory terminal window with sbt running. These tests teardown their keyspaces, tables, and connections, run them one at a time so ScalaTest doesn't mix them up and report false errors.

> it:compile

> it:testOnly com.github.garyaiki.dendrites.cassandra.BoundStmtSpec

> it:testOnly

> it:testOnly

> it:testOnly

> it:testOnly

> it:testOnly

> it:testOnly

> it:testOnly

> it:testOnly

With Kafka shoppingcartcmd-topic

> it:testOnly

Stop Cassandra

Exit sbt to close its connection to Cassandra. If you kill Cassandra while sbt is still it will keep trying to reconnect to Cassandra.

Then, Ctrl-C in the terminal running Cassandra

Akka Http


Balances Server is an example server that handles requests from integration tests under src/it/scala

Run Balances Server

These integration tests need Balances Server running to handle HTTP requests. > bgRun Runs Balances Server an Http server in the background

Run integration tests

In the dendrites directory terminal with sbt running

> it:compile

> it:testOnly

> it:testOnly com.github.garyaiki.dendrites.examples.account.http.*

Sometimes, some of these tests fail because Balances Server has a default limit of 4 concurrent requests and tests are running in parallel and may not get time on the server. If this happens, re-run the failed tests one at a time.

Stop Balances Server

Ctrl-C in the terminal window running Balances Server

Typesafe Config

dendrites uses Typesafe Config. Traits with names ending in Config define configuration properties for components. This mediates configuration from usage, so you may use these traits with different configuration sources.

Typesafe Config user guide, Akka config user guide

Configurations in /src/main/resources/reference.conf can be overridden by your application.conf.

The akka section is for logging and has Akka specific logging settings

Under the dendrites section

algebird has default settings for CountMinSketch, DecayedValue, HyperLogLog, and QTree

blocking-dispatcher configures a thread pool to be used when there are blocking calls

checking-balances, money-market-balances, and savings-balances are example http client configurations

kafka is an example topic and timeout configuration

cassandra is an example cluster and keyspace configuration

timer is asychronous and exponential backoff timeout configuration

Logback configuration

Logback configuration guide

Logging configuration for running tests and integration tests is in /src/test/resources/logback.xml

Your application Logback configuration is done separately. You can copy logback.xml paste it into your /src/main/resources/ and modify it.

Logging Separation

Popular Cqrs Projects
Popular Microservices Projects
Popular Software Architecture Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Event Sourcing
Reactive Programming
Akka Http
Akka Streams