The on premise, open source version of Eventuate, which is a platform for developing transactional business applications that use the microservice architecture.
Java JavaScript CSS Shell HTML Groovy
Permalink
Failed to load latest commit information.
.circleci WIP CircleCI workflows Jun 14, 2018
buildSrc Fixed NPEs Feb 20, 2018
eventuate-local-console A simple console Feb 10, 2017
eventuate-local-java-cdc-service Fixing properties. Apr 10, 2018
eventuate-local-java-common-broker #86: Support not Only Kafka. Extracting new modules, data producer, d… Apr 25, 2018
eventuate-local-java-common Support for Postgres WAL-based CDC Mar 28, 2018
eventuate-local-java-embedded-cdc-autoconfigure Added source jars Jan 5, 2017
eventuate-local-java-embedded-cdc Improved logging in DebeziumCdcStartupValidator Jul 12, 2018
eventuate-local-java-jdbc-autoconfigure Added source jars Jan 5, 2017
eventuate-local-java-jdbc-tests #54: Test Hangs from Time to Time. Switching to hikaru cp in module … Jul 12, 2018
eventuate-local-java-jdbc #44. Make kafka settings customizable. Jun 15, 2018
eventuate-local-java-kafka Merge pull request #88 from dartartem/master Jun 22, 2018
eventuate-local-java-test-util Spring 2 support. Dec 14, 2017
gradle/wrapper clean up Dec 14, 2017
i Added architecture diagram Aug 6, 2016
kafka Updating kafka Jun 9, 2018
mysql.conf.d Initial commit Aug 6, 2016
mysql improving custom db support. Nov 23, 2017
new-cdc Fixing merge. Jun 15, 2018
postgres Refactoring. Apr 11, 2018
scripts #54: Test Hangs from Time to Time. Reorganizing env scripts. Jul 12, 2018
zookeeper Build Zookeeper and Kafka, Fixed published repository name Dec 3, 2017
.gitignore A simple console Feb 10, 2017
LICENSE.md Initial commit Aug 6, 2016
README.adoc Added bintray version badge Jun 27, 2017
build.gradle WIP CircleCI workflows Jun 14, 2018
docker-compose-cdc-mysql.yml Moving some env variables to app properties. Apr 9, 2018
docker-compose-cdc-postgres-polling.yml Moving some env variables to app properties. Apr 9, 2018
docker-compose-eventuate-local-for-testing-mysql.yml Support for Postgres WAL-based CDC Mar 28, 2018
docker-compose-eventuate-local-mysql.yml Moving some env variables to app properties. Apr 9, 2018
docker-compose-eventuate-local-new-cdc-for-testing-mysql.yml Support for Postgres WAL-based CDC Mar 28, 2018
docker-compose-eventuate-local-postgres-polling.yml Moving some env variables to app properties. Apr 9, 2018
docker-compose-mysql.yml Support for Postgres WAL-based CDC Mar 28, 2018
docker-compose-new-cdc-mysql.yml Moving some env variables to app properties. Apr 9, 2018
docker-compose-new-cdc-postgres-polling.yml Moving some env variables to app properties. Apr 9, 2018
docker-compose-new-cdc-postgres-wal.yml Support for Postgres WAL-based CDC Mar 28, 2018
docker-compose-postgres-polling.yml Support for Postgres WAL-based CDC Mar 28, 2018
docker-compose-postgres-wal.yml Removing redundant postgres docker directory. Apr 11, 2018
gradle.properties Refactoring. Dec 14, 2017
gradlew clean up Dec 14, 2017
gradlew.bat clean up Dec 14, 2017
settings.gradle #86: Support not Only Kafka. Extracting new modules, data producer, d… Apr 25, 2018

README.adoc

Eventuate Local

download
logo

Simplifying the development of transactional microservices

Eventuate™ Local is the on-premise, open source version of Eventuate™, which is a platform for developing transactional business applications that use the microservice architecture. Eventuate provides an event-driven programming model for microservices that is based on event sourcing and CQRS. Eventuate™ Local has the same API as the SaaS version but uses a SQL database to persist events and Kafka as the publish/subscribe mechanism.

Eventuate Local consists of:

  • A framework for developing (microservice-based) applications.

  • An event store consisting of a SQL database (currently MySQL) and Kafka.

Big Picture

The framework persists events in an EVENTS table in the SQL database and subscribes to events in Kafka. A change data capture component tails the database transaction log and publishes each event to Kafka. There is a Kafka topic for each aggregate type.

About change data capture

Eventuate Local has a change data capture (CDC) component that

  1. tails the MySQL transaction log

  2. publishes each event inserted into the EVENTS table to Kafka topic for the event’s aggregate.

The CDC component runs either embedded within each application or as a service cdcservice.

Setting up Eventuate Local

To use Eventuate Local you need to

  1. Create EVENT and ENTITIES tables in a MySQL database.

  2. Run Apache Zookeeper, Apache Kafka and the optional cdcservice

  3. Use the Eventuate Local artifacts in your application.

The easiest way to get started is to run a set of Docker containers using Docker Compose as described below.

The quick setup

This is the fastest way to get started with Eventuate Local.

Set the DOCKER_HOST_IP environment variable

You must first set the environment variable DOCKER_HOST_IP to the IP address of the machine running Docker. For example, if you are running Docker Machine on Mac/Windows this would be the IP address of the VirtualBox VM. Please note that you cannot set DOCKER_HOST_IP to localhost since that will not resolve to the correct IP address within a Docker container.

Run the Eventuate Local Docker containers

Next, you can run the Docker containers. First, copy docker-compose-eventuate-local.yml to your project. Then, launch the Docker containers by running the following command:

docker-compose -f docker-compose-eventuate-local.yml

This command creates the following containers:

  • Apache Zookeeper - used by both the change data capture component and Kafka

  • Apache Kafka - message broker

  • MySQL - MySQL database that has the eventuate schema already defined

  • cdcservice - the change data capture component

For convenience, you might want to add the contents of this file to your project’s docker-compose.yml file.

Set some environment variables

In order for your Sprint Boot application to use Eventuate Local you need to set the following application properties:

spring.datasource.url=jdbc:mysql://${DOCKER_HOST_IP}/eventuate
spring.datasource.username=mysqluser
spring.datasource.password=mysqlpw
eventuateLocal.kafka.bootstrapServers=$DOCKER_HOST_IP:9092
eventuateLocal.zookeeper.connectionString=$DOCKER_HOST_IP:2181
eventuateLocal.cdc.dbUserName=root
eventuateLocal.cdc.dbPassword=rootpassword

A convenient way to do that is to set the corresponding OS environment variables:

export SPRING_DATASOURCE_URL=jdbc:mysql://${DOCKER_HOST_IP}/eventuate
export SPRING_DATASOURCE_USERNAME=mysqluser
export SPRING_DATASOURCE_PASSWORD=mysqlpw
export SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.jdbc.Driver
export EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS=$DOCKER_HOST_IP:9092
export EVENTUATELOCAL_CDC_DB_USER_NAME=root
export EVENTUATELOCAL_CDC_DB_PASSWORD=rootpassword
export EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING=$DOCKER_HOST_IP:2181

You can do that by running the set-env.sh bash script:

Use the Eventuate Local libraries

If you are using Gradle then please specify the following in gradle.properties:

eventuateLocalVersion=0.11.0.RELEASE

and instead of the Eventuate HTTP/STOMP artifacts, specify the following:

compile "io.eventuate.local.java:eventuate-local-java-jdbc:${eventuateLocalVersion}"
compile "io.eventuate.local.java:eventuate-local-java-embedded-cdc-autoconfigure:${eventuateLocalVersion}"

For more information about developing applications with Eventuate Local see the Getting Started guide.

Configuring your application containers

You need to configure your application’s containers to connect to the Eventuate MySQL, Kafka and Zookeeper containers. You can do that using the following in your project’s docker-compose.yml file using links and environment:

mycontainer:
  ...
  links:
    - mysql
    - kafka
    - zookeeper
  environment:
    SPRING_DATASOURCE_URL: jdbc:mysql://mysql/eventuate
    SPRING_DATASOURCE_USERNAME: mysqluser
    SPRING_DATASOURCE_PASSWORD: mysqlpw
    SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.jdbc.Driver
    EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
    EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
    EVENTUATELOCAL_CDC_DB_USER_NAME: root
    EVENTUATELOCAL_CDC_DB_PASSWORD: rootpassword

Note: in order for this to work you have either copied the container definitions from docker-compose-eventuate-local.yml to you docker-compose.yml file or you are running docker-compose with multiple -f arguments:

docker-compose -f docker-compose-eventuate-local.yml -f docker-compose.yml up -d

The not so quick version

TBD

Running an example application

The Eventuate example applications support both Eventuate and Eventuate Local.

To build an example with Eventuate Local, use this command:

./gradlew -P eventuateDriver=local assemble

To start the Docker Containers with Eventuate Local run this command:

docker-compose -f docker-compose-eventuate-local.yml up -d

The docker-compose-eventuate-local.yml file defines the application containers and the Eventuate Local containers and links them appropriately.