Git Product home page Git Product logo

axon-demo's Introduction

Axonframework Bank Demo Application using Kotlin language

  • Dispatch Interceptors
  • Custom Command Handler
  • Distributed Command Bus
  • Sagas (using EventScheduler (Quartz))
  • Group Processors Configuration
  • TrackingEventProcessor (start|stop|replay)
  • Upcaster
  • Kafka Integration
  • Custom Snapshot Configuration

Start the Postgresql and Kafka:

$ docker-compose up

Start the applications in this order:

axon-eureka

Eureka Server port 8761. Dashboard http://localhost:8761

$ mvn clean install
$ java -jar axon-eureka/target/axon-eureka-1.0.0-SNAPSHOT.jar

axon-command

If you want to see the Distributed Command Bus working, start at least two of these.

$ java -jar -Dserver.port=8085 axon-command/target/axon-command-1.0.0-SNAPSHOT.jar
$ java -jar -Dserver.port=8086 axon-command/target/axon-command-1.0.0-SNAPSHOT.jar

Wait few seconds and go back to Eureka Dashboard. You will see both instances registered there.

axon-gateway

$ java -jar axon-gateway/target/axon-gateway-0.0.1-SNAPSHOT.jar

If you started more then one axon-command you can call every instance directly like

$ curl -XGET http://localhost:8085/accounts

and

$ curl -XGET http://localhost:8086/accounts

But that's not very pretty because you have to know the exactly address/port to every instance running. Spring Gateway will help you make agnostics calls to axon-command application. Start this application and wait a few seconds to everything get register correctly. Now, start making calls to the gateway itself instead of calling the instances directly. Spring Gateway will load-balance your calls to all axon-command instances registered at Eureka-Server.

Now, you can make all your calls to the Gateway at port 8760:

E.g.

$ curl -XGET http://localhost:8760/accounts

axon-kafka-consumer

axon-command is configured to send all events to a Kafka Topic. This project will consume those events using the Axon Tracking Processor approach.

java -jar axon-kafka-consumer/target/axon-kafka-consumer-1.0.0-SNAPSHOT.jar

If you are using Intellij you can open this file and just click on the Green Arrow Icon to make the calls.

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.