Giter VIP home page Giter VIP logo

eventuate-examples-java-customers-and-orders's Introduction

This is the Java version of the customers and orders example that I've used in numerous presentations on developing microservices with event sourcing and CQRS. The code is built using the Eventuate platform. It illustrates how to implement an eventually consistent credit limit check using event sourcing. For more information, see this presentation from Gluecon 2016

About Eventuate™

The application is built using Eventuate, which is an application platform for writing transactional microservices. It provides a simple yet powerful event-driven programming model that is based on event sourcing and Command Query Responsibility Segregation (CQRS). Eventuate solves the distributed data management problems inherent in a microservice architecture. It consists of a scalable, distributed event store and client libraries for various languages and frameworks including Java, Scala, and the Spring framework.

Building and running the application.

This is a Java 8, Gradle project. However, you do not need to install Gradle since it will be downloaded automatically. You just need to have Java 8 installed.

Building and running using Eventuate Local

First, build the application:

./gradlew assemble

Next, you can launch the application using Docker Compose

Note:

If the containers aren't accessible via localhost - e.g. you are using Docker Toolbox, you will have to use ${DOCKER_HOST_IP} instead of localhost. See this http://eventuate.io/docs/usingdocker.html[guide to setting DOCKER_HOST_IP] for more information.

./gradlew <database-mode>ComposeBuild
./gradlew <database-mode>ComposeUp

Where database-mode is one of:

  • mysqlbinlog - use MySQL with Binlog-based event publishing
  • postgreswal - use Postgres with Postgres WAL-based event publishing
  • postgrespolling - use Postgres with generic JDBC polling-based event publishing

Finally, you can use the Swagger UI provided by the services to create customers and orders, and view the order history:

  • http://localhost:8081/swagger-ui.html - Create a customer
  • http://localhost:8083/swagger-ui.html - Create an order
  • http://localhost:8082/swagger-ui.html - View the customer and the order

(Hint: best to open these URLs in separate tabs)

The script ./show-urls.sh will display the URLs.

eventuate-examples-java-customers-and-orders's People

Contributors

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