Giter Club home page Giter Club logo

hotel-demo's Introduction

AxonIQ hotel demo

It's the implementation of the example used in this blog post: https://eventmodeling.org/posts/what-is-event-modeling/

Event modeling adopts Event Storming sticky notes. The final piece was the UI/UX aspects to complete what more resembles a movie story board (white board - or digital white board). While Event Storming focuses in discovering the problem space, Event Modeling creates a blueprint for a solution.

Download specification (Demo.pdf)

The Miro board is publicly available (view only) as well.

Prerequisites

  • Java 11

Recommendations

Installing the Axon Framework IntelliJ plugin will help you visualize the application's publishers and handlers. You can easily install this by going to the Marketplace in your IntelliJ plugin settings.

Intellij Plugin Screenshot

Running the application(s) locally

Requirements

You can download a ZIP file with AxonServer as a standalone JAR. This will also give you the AxonServer CLI and information on how to run and configure the server.

Alternatively, you can run the following command to start AxonServer in a Docker container:

docker run -d --name axonserver -p 8024:8024 -p 8124:8124 axoniq/axonserver
mvn clean verify

Booking

cd booking/
mvn spring-boot:run

Inventory

cd inventory/
mvn spring-boot:run
  • Create your account (you can select free Developer account option) https://cloud.axoniq.io/
  • Create booking and inventory contexts
  • Context
  • Create application bindings (make sure that booking application can access both contexts, booking and inventory)
  • Bindings
  • Copy the configuration settings into booking/../application-cloud.properties and inventory/../application-cloud.properties.
  • Check the Java configuration to make sure the context names are matching.
  • Run the booking application (cd booking): mvn spring-boot:run -Dspring-boot.run.profiles=cloud
  • Run the inventory application (cd inventory): mvn spring-boot:run -Dspring-boot.run.profiles=cloud
  • Connected Applications
  • Access the local booking application in the web browser http://localhost:8080/
  • Access the local inventory application in the web browser http://localhost:8081/

Running all on Kubernetes

Deployment on Kubernetes (CaaS) is documented in .k8s/Readme.md. It demonstrates the usage of Axon Server Standard Edition and Axon Server Enterprise Edition in a multi-context setup with access control enabled. If you want to actually run Axon Server Enterprise Edition you need a valid license file.


Created with ❤️ by AxonIQ

hotel-demo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hotel-demo's Issues

woud you mind add optimistic locking to this demo? sincere thanks a lot

public class AccountAggregate {

@AggregateIdentifier
private String id;

//...ignore other fields
@AggregateVersion
@Version
private Long version;

@EventSourcingHandler
public void create(CreateEvent cmd, @SequenceNumber Long aggregateVersion) {
    id = cmd.getAccountId();
    userName = cmd.getUserName();
    password = cmd.getPassword();
    balance = cmd.getAmount();
    version = aggregateVersion;
}

public class SubtractCmd {
private String txId;
private String sourceAccId;
@TargetAggregateIdentifier
private String targetAccId;
private Double amount;
@TargetAggregateVersion
private Long version;
}

my code reference to AxonFramework/AxonFramework#721,
but the work of "file it on the Reference Guide repository" was not done yet.

thank you very much!!!

convert exception for all of three serizlizer of JACKSON with mysql and axonserver se

1: config:

spring.flyway.enabled=false
spring.datasource.url=jdbc:mysql://localhost:3306/booking
spring.datasource.username=root
spring.datasource.password=12345678
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
axon.serializer.general=JACKSON
axon.serializer.events=JACKSON
axon.serializer.messages=JACKSON

2: register account
3: curl -X GET -H "Accept:/" -H "Content-Type:application/x-www-form-urlencoded" "http://localhost:8080/accounts"
4: exception:

java.lang.IllegalArgumentException: Retrieved response [class java.util.ArrayList] is not convertible to a List of the expected response type [class io.axoniq.demo.hotel.booking.query.api.AccountResponseData]
at org.axonframework.messaging.responsetypes.MultipleInstancesResponseType.convert(MultipleInstancesResponseType.java:113) ~[axon-messaging-4.5.4.jar:4.5.4]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.FluxFilterFuseable] :
reactor.core.publisher.Flux.filter(Flux.java:5063)
org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:206)
Error has been observed at the following site(s):
|_ Flux.filter ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:206)
|_ Flux.map ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:207)
|_ Flux.transform ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.query(DefaultReactorQueryGateway.java:91)
|_ Flux.next ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.query(DefaultReactorQueryGateway.java:92)
|_ checkpoint ⇢ checkBugWithCheckPoint2
|_ Mono.map ⇢ at org.springframework.http.codec.json.AbstractJackson2Encoder.encode(AbstractJackson2Encoder.java:150)
|_ Mono.flux ⇢ at org.springframework.http.codec.json.AbstractJackson2Encoder.encode(AbstractJackson2Encoder.java:151)
|_ Flux.singleOrEmpty ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:129)
|_ Mono.switchIfEmpty ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:130)
|_ Mono.flatMap ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:134)
|_ checkpoint ⇢ Handler io.axoniq.demo.hotel.booking.query.web.rest.AccountQueryController#all() [DispatcherHandler]
|_ Mono.flatMap ⇢ at org.springframework.web.reactive.DispatcherHandler.lambda$handleResult$5(DispatcherHandler.java:182)
|_ Mono.onErrorResume ⇢ at org.springframework.web.reactive.DispatcherHandler.handleResult(DispatcherHandler.java:181)
|_ checkpoint ⇢ springfox.boot.starter.autoconfigure.SwaggerUiWebFluxConfiguration$CustomWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.web.cors.reactive.CorsWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ io.opentracing.contrib.spring.web.webfilter.TracingWebFilter [DefaultWebFilterChain]
|_ Mono.error ⇢ at org.springframework.web.server.handler.ExceptionHandlingWebHandler$CheckpointInsertingHandler.handle(ExceptionHandlingWebHandler.java:98)
|_ checkpoint ⇢ HTTP GET "/accounts" [ExceptionHandlingWebHandler]
Stack trace:
...

located: org.axonframework.messaging.responsetypes.MultipleInstancesResponseType#convert response

because the parameter "response" is "ArrayList" , not expectedReponseType "io.axoniq.demo.hotel.booking.query.api.AccountResponseData"

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.