Giter Site home page Giter Site logo

ngoquangmanh / eventuate-tram-core-examples-basic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eventuate-tram/eventuate-tram-core-examples-basic

0.0 0.0 0.0 229 KB

Basic examples for Eventuate Tram

License: Other

Shell 12.79% Java 86.93% Dockerfile 0.28%

eventuate-tram-core-examples-basic's Introduction

Eventuate Tram basic examples

Eventuate Tram implements transactional messaging for microservices written using JDBC. This project implements the examples shown in that project’s README.

It consists of the following modules:

  • eventuate-tram-examples-common - the examples for basic messaging, domain events and command/async reply

  • eventuate-tram-examples-in-memory - runs the examples using in-memory stubs

  • eventuate-tram-examples-jdbc-kafka - runs the examples using MySQL and Apache Kafka

About eventuate-tram-examples-common

This module defines the transactional messaging examples:

  • Basic messaging

  • Domain events

  • Commands, which implement request/asynchronous response

You can run the examples using the tests in the eventuate-tram-examples-in-memory and eventuate-tram-examples-jdbc-kafka modules.

About eventuate-tram-examples-in-memory - running in-memory examples

This module executes the examples using eventuate-tram-in-memory module, which is extremely useful for writing fast running tests.

To run this version of the tests:

./gradlew :eventuate-tram-examples-in-memory:test

About eventuate-tram-examples-jdbc-kafka - running examples with MySQL and Apache Kafka

This module executes the examples using MySQL and Apache Kafka.

Set DOCKER_HOST_IP environment variable

Before running MySQL and Apache Kafka using Docker Compose, you first need to set the DOCKER_HOST_IP environment variable. This must be an IP address or resolvable hostname. It cannot be localhost or 127.0.0.1. Please see this guide to setting DOCKER_HOST_IP for more information.

Run MySQL and Apache Kafka

Once you have set DOCKER_HOST_IP you can then run MySQL and Apache Kafka using Docker Compose.

gradlew <database><mode>ComposeBuild
gradlew <database><mode>ComposeUp

where <database><mode> one of

  • mysqlbinlog

  • postgrespolling

  • postgreswal

Run the tests

Once the containers have started you can run the tests:

./gradlew :eventuate-tram-examples-jdbc-kafka:test

Inspect the database

You can inspect the Eventuate Tram-related database tables:

$ ./mysql-cli.sh -it
Welcome to the MySQL monitor.  Commands end with ; or \g.
...

mysql> select * from message\G
*************************** 1. row ***************************
         id: 00000168d96469db-acde480011220000
destination: destination1549835461824
    headers: {"DESTINATION":"destination1549835461824","ID":"00000168d96469db-acde480011220000"}
    payload: Hello1549835461824
  published: 0

...
mysql> select * from received_messages\G
*************************** 1. row ***************************
consumer_id: commandDispatcheId1549835467791
 message_id: 00000168d9647f65-acde480011220000
*************************** 2. row ***************************
...
mysql> quit
Bye

Clean up

To clean up:

./gradlew <database><mode>ComposeDown

For more information

Please read the Eventuate Tram getting started guide or look at the examples.

eventuate-tram-core-examples-basic's People

Contributors

cer avatar dartartem 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.