A library to implement event-sourcing microservices
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper revert gradle wrapper to 4 and refactor signing configuration Feb 6, 2019
synapse-aws-auth revert gradle wrapper to 4 and refactor signing configuration Feb 6, 2019
synapse-aws-kinesis Introduces decoder interface to decode receiver-specific objects into… Feb 18, 2019
synapse-aws-sqs
synapse-compaction-aws-s3
synapse-core
synapse-edison Introduced TextMessage instead of Message<String> in the Feb 18, 2019
synapse-examples Introduced TextMessage instead of Message<String> in the Feb 18, 2019
synapse-redis
synapse-testsupport Introduced TextMessage instead of Message<String> in the Feb 18, 2019
.gitignore create project files Nov 3, 2017
.travis.yml
CHANGELOG.md
LICENSE
README.md Updates to AWS SDK 2.2.0 Dec 23, 2018
USERGUIDE.md Introduced TextMessage instead of Message<String> in the Feb 18, 2019
build.gradle
gradle.properties Fixes bug that don't create a new message when retry with a corrupt b… Jun 13, 2018
gradlew add gradle wrapper Nov 3, 2017
gradlew.bat
jacoco.gradle Added jacoco plugin Sep 20, 2018
release.sh add release script Feb 16, 2018
settings.gradle Adds new module 'synapse-redis' containing a preliminary version of a… Nov 12, 2018
signing.gradle

README.md

OTTO Synapse

Eventsourcing & message passing for Spring Boot microservices.

Maven Central

User Guide

In most cases, microservices today make use of synchronous communication using RESTful APIs. This approach has many advantages: most notably, developers will already know how to implement such kind of systems.

Especially in larger systems consisting of, say: dozens or hundreds of microservices, REST APIs do not feel appropriate anymore. The smaller the services get, the more overhead is needed to persist data, cache data, implement, document and test the APIs, and so on.

Eventsourcing is a radically different approach to implement microservices:

"Capture all changes to an application state as a sequence of events" (Martin Fowler)

  • Services communicate between each other by exchanging asynchronous messages over messaging channels.
  • Messages might be "commands": a command to do something (in the future) like, for example, "Place Order"
  • More often, messages will contain "events": the information that something has happened in the past like, for example, "Product Deleted".
  • Services are constantly reading and processing messages from messaging channels.
  • On startup, a service will read all messages, from the oldest to the newest one, until the internal state of the service is up-to-date. Because doing so would take increasingly longer over time, regularly taken snapshots containing a compacted list of messages is used.

Synapse is a library implemented at otto to make it easy to create eventsourcing Spring Boot microservices. Annotations are used to make it as simple as possible to use Synapse.

Today, Synapse is supporting AWS SQS, Kinesis and Redis (as a message store). However, it should be easy to add implementations for other infrastructures like, for example Kafka.

Message

Enterprise Integration Patterns: Message

EIP: Message

Message Logs

Message Queues

Sending Messages

Receiving Messages

Intercepting Messages

State Repositories

Message Stores

Compaction

EventSource

  1. Install Docker and LocalStack

Docker is required to run LocalStack, so first you have to install Docker.

LocalStack is "A fully functional local AWS cloud stack". Synapse is using LocalStack in order to run integration tests locally, without having to access the "real" AWS services.

Follow the instructions here: https://github.com/localstack/localstack

  1. Building Synapse
./gradlew startLocalStack
./gradlew build
./gradlew stopLocalStack