Giter VIP home page Giter VIP logo

axonbank's Introduction

Axon Framework logo

Axon Framework

Build modern event-driven systems with AxonIQ technology.
Product Description »

Code Samples Repo · Technical Overview · Feature / Bug Request

Axon Framework

Maven Central Build Status SonarCloud Status

Axon Framework is a framework for building evolutionary, event-driven microservice systems based on the principles of Domain-Driven Design (DDD), Command-Query Responsibility Separation (CQRS), and Event Sourcing.

Bootstrap logo

Axon Framework provides you with the necessary building blocks to follow these principles. Examples of building blocks are aggregate design handles, aggregate repositories, command buses, saga design handles, event stores, query buses, and more. The framework provides sensible defaults for all of these components out of the box.

The messaging support for commands, events, and queries is at the core of these building blocks. It is the messaging basics that enable an evolutionary approach towards microservices through the location transparency they provide.

Axon will also assist in distributing applications to support scalability or fault tolerance, for example. The most accessible and quick road forward would be to use Axon Server to seamlessly adjust message buses to distributed implementations. Axon Server provides a distributed command bus, event bus, query bus, and an efficient event store implementation for scalable event sourcing. Additionally, the Axon Framework organization has several extensions that can help in this space.

All this helps to create a well-structured application without worrying about the infrastructure. Hence, your focus can shift from non-functional requirements to your business functionality.

For more information on anything Axon, please visit our website, http://axoniq.io.

Getting started

Numerous resources can help you on your journey in using Axon Framework. A good starting point is AxonIQ Developer Portal, which provides links to resources like blogs, videos, and descriptions.

Furthermore, below are several other helpful resources:

  • The quickstart page of the documentation provides a simplified entry point into the framework with the quickstart project.
  • We have our very own academy! The introductory courses are free, followed by more in-depth (paid) courses.
  • When ready, you can quickly and easily start your very own Axon Framework based application at https://start.axoniq.io/. Note that this solution is only feasible if you want to stick to the Spring ecosphere.
  • The reference guide explains all of the components maintained within Axon Framework's products.
  • If the guide doesn't help, our forum provides a place to ask questions you have during development.
  • The hotel demo shows a fleshed-out example of using Axon Framework.
  • The code samples repository contains more in-depth samples you can benefit from.

Receiving help

Are you having trouble using any of our libraries or products? Know that we want to help you out the best we can! There are a couple of things to consider when you're traversing anything Axon:

  • Checking the reference guide should be your first stop.
  • When the reference guide does not cover your predicament, we would greatly appreciate it if you could file an issue for it.
  • Our forum provides a space to communicate with the Axon community to help you out. AxonIQ developers will help you out on a best-effort basis. And if you know how to help someone else, we greatly appreciate your contributions!
  • We also monitor Stack Overflow for any question tagged with axon. Similarly to the forum, AxonIQ developers help out on a best-effort basis.

Feature requests and issue reporting

We use GitHub's issue tracking system) for new feature requests, framework enhancements, and bugs. Before filing an issue, please verify that it's not already reported by someone else. Furthermore, make sure you are adding the issue to the correct repository!

When filing bugs:

  • A description of your setup and what's happening helps us figure out what the issue might be.
  • Do not forget to provide the versions of the Axon products you're using, as well as the language and version.
  • If possible, share a stack trace. Please use Markdown semantics by starting and ending the trace with three backticks (```).

When filing a feature or enhancement:

  • Please provide a description of the feature or enhancement at hand. Adding why you think this would be beneficial is also a great help to us.
  • (Pseudo-)Code snippets showing what it might look like will help us understand your suggestion better. Similarly as with bugs, please use Markdown semantics for code snippets, starting and ending with three backticks (```).
  • If you have any thoughts on where to plug this into the framework, that would be very helpful too.
  • Lastly, we value contributions to the framework highly. So please provide a Pull Request as well!

axonbank's People

Contributors

abuijze avatar altfatterz avatar bilak avatar jkallen avatar jvanderkallen avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

axonbank's Issues

how transaction works

I'm wondering how saga transaction works,does it support distributed-transacton or only local transaction?
I wrote a mock code to verify simple transaction( org.axonframework.samples.bank.command.BankAccount#on(MoneyAddedEvent event) ),see below:

@EventHandler
public void on(MoneyAddedEvent event) {
//mock raise exception here->
if (event.getAmount() == 5) throw new RuntimeException("mock ex trigger rollback");
//<-
balanceInCents += event.getAmount();
}

the detail scenario is 'bank transfer': add 10 to account A,also add 10 to account B,then transfer 5 from A to B,which will raise excetion,under my understanding,nothing would be changed,but the result shows that A lost 5,B still 10,btw,I make a little change to use JPA(with MySQL5Dialect)&transaction

appreciate your feedback,thanks a lot....

DestinationBankAccountNotFoundEvent not properly persisted when using JPA

hi
I'm trying use JpaSagaStore&JpaTransactionManager to run the sample and mock an AggregateNotFoundException, but I got JDBC exception as below:
Hibernate: insert into domain_event_entry (event_identifier, meta_data, payload, payload_revision, payload_type, time_stamp, aggregate_identifier, sequence_number, type) values (?, ?, ?, ?, ?, ?, ?, ?, ?) 2017-02-07 12:11:29.489 WARN 33185 --- [nboundChannel-2] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1048, SQLState: 23000 2017-02-07 12:11:29.489 ERROR 33185 --- [nboundChannel-2] o.h.engine.jdbc.spi.SqlExceptionHelper : Column 'type' cannot be null

the direct step to mock the AggregateNotFoundException (then the DestinationBankAccountNotFoundEvent trigged),like below:
org.axonframework.samples.bank.command.BankAccountCommandHandler#handle(CreditDestinationBankAccountCommand command) { omitted... Aggregate<BankAccount> bankAccountAggregate = repository.load(command.getBankAccountId()+"aa"); omitted... }

it seems somehow the domain-event not properly persisted,can anyone explain this?
btw,if I use InMemorySagaStore&InMemoryEventStorageEngine,this problem won't happen

[critical] Some commands are not executed - but tests are however all green

The
@CommandHandler public void handle(DebitSourceBankAccountCommand command)
and
@CommandHandler public void handle(CreditDestinationBankAccountCommand command)
are never invoked.

I'm not sure why because they seems to be pushed on the bus

DebitSourceBankAccountCommand command = new DebitSourceBankAccountCommand(...); commandBus.dispatch(asCommandMessage(command), LoggingCallback.INSTANCE);

This is confirmed by two facts

  • Incomplete code coverage > BankAccountCommandHandler | 100% (1/1) | 20% (1/5) | 22% (4/18) -- | -- | -- | --
  • If we remove these methods, the tests are still passing, which is quite surprising.

Could you have a look at that?
Thanks a lot.
Octave

Distributed version not working at the moment

I've run the build instructions:

    mvn clean install
    mvn -pl web docker:build
    docker-compose up db (this will create and initialize the db container, you can stop the container after it has been initialized)
    docker-compose up

Both instances die with this message:

axonbank1_1  | 2018-09-05 09:35:53.324  WARN 1 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bankTransferController' defined in URL [jar:file:/axon-bank-web-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/org/axonframework/samples/bank/web/BankTransferController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.axonframework.spring.config.AxonConfiguration': Invocation of init method failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'axonConfig': Unsatisfied dependency expressed through field 'eventBus'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eventBus' defined in class path resource [org/axonframework/boot/autoconfig/AxonAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eventStore' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventStorageEngine' defined in class path resource [org/axonframework/boot/autoconfig/JpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.eventsourcing.eventstore.EventStorageEngine]: Factory method 'eventStorageEngine' threw exception; nested exception is java.lang.NullPointerException
axonbank1_1  | 2018-09-05 09:35:53.325  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
axonbank1_1  | 2018-09-05 09:35:53.339  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service Tomcat
axonbank1_1  | 2018-09-05 09:35:53.379  INFO 1 --- [           main] utoConfigurationReportLoggingInitializer : 
axonbank1_1  | 
axonbank1_1  | Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
axonbank1_1  | 2018-09-05 09:35:53.395 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application startup failed
axonbank1_1  | 
axonbank1_1  | org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bankTransferController' defined in URL [jar:file:/axon-bank-web-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/org/axonframework/samples/bank/web/BankTransferController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.axonframework.spring.config.AxonConfiguration': Invocation of init method failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'axonConfig': Unsatisfied dependency expressed through field 'eventBus'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eventBus' defined in class path resource [org/axonframework/boot/autoconfig/AxonAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eventStore' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventStorageEngine' defined in class path resource [org/axonframework/boot/autoconfig/JpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.eventsourcing.eventstore.EventStorageEngine]: Factory method 'eventStorageEngine' threw exception; nested exception is java.lang.NullPointerException
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
axonbank1_1  | 	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
axonbank1_1  | 	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
axonbank1_1  | 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
axonbank1_1  | 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
axonbank1_1  | 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
axonbank1_1  | 	at org.axonframework.samples.bank.AxonBankApplication.main(AxonBankApplication.java:26) [classes!/:0.0.1-SNAPSHOT]
axonbank1_1  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
axonbank1_1  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
axonbank1_1  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
axonbank1_1  | 	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
axonbank1_1  | 	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
axonbank1_1  | 	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
axonbank1_1  | 	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
axonbank1_1  | 	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
axonbank1_1  | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.axonframework.spring.config.AxonConfiguration': Invocation of init method failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'axonConfig': Unsatisfied dependency expressed through field 'eventBus'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eventBus' defined in class path resource [org/axonframework/boot/autoconfig/AxonAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eventStore' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventStorageEngine' defined in class path resource [org/axonframework/boot/autoconfig/JpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.eventsourcing.eventstore.EventStorageEngine]: Factory method 'eventStorageEngine' threw exception; nested exception is java.lang.NullPointerException
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	... 27 common frames omitted
axonbank1_1  | Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'axonConfig': Unsatisfied dependency expressed through field 'eventBus'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eventBus' defined in class path resource [org/axonframework/boot/autoconfig/AxonAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eventStore' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventStorageEngine' defined in class path resource [org/axonframework/boot/autoconfig/JpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.eventsourcing.eventstore.EventStorageEngine]: Factory method 'eventStorageEngine' threw exception; nested exception is java.lang.NullPointerException
axonbank1_1  | 	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:372) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.axonframework.spring.config.SpringAxonAutoConfigurer.lambda$registerSagaBeanDefinitions$27(SpringAxonAutoConfigurer.java:217) ~[axon-spring-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.axonframework.spring.config.SpringAxonAutoConfigurer$LazyRetrievedModuleConfiguration.initialize(SpringAxonAutoConfigurer.java:329) ~[axon-spring-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.axonframework.config.DefaultConfigurer.lambda$invokeInitHandlers$14(DefaultConfigurer.java:285) ~[axon-core-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at java.util.ArrayList.forEach(ArrayList.java:1249) ~[na:1.8.0_111]
axonbank1_1  | 	at org.axonframework.config.DefaultConfigurer.invokeInitHandlers(DefaultConfigurer.java:285) ~[axon-core-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.axonframework.config.DefaultConfigurer.buildConfiguration(DefaultConfigurer.java:274) ~[axon-core-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.axonframework.spring.config.AxonConfiguration.afterPropertiesSet(AxonConfiguration.java:166) ~[axon-spring-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	... 47 common frames omitted
axonbank1_1  | Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eventBus' defined in class path resource [org/axonframework/boot/autoconfig/AxonAutoConfiguration.class]: Unsatisfied dependency expressed through method 'eventStore' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventStorageEngine' defined in class path resource [org/axonframework/boot/autoconfig/JpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.eventsourcing.eventstore.EventStorageEngine]: Factory method 'eventStorageEngine' threw exception; nested exception is java.lang.NullPointerException
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	... 74 common frames omitted
axonbank1_1  | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventStorageEngine' defined in class path resource [org/axonframework/boot/autoconfig/JpaAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.eventsourcing.eventstore.EventStorageEngine]: Factory method 'eventStorageEngine' threw exception; nested exception is java.lang.NullPointerException
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	... 87 common frames omitted
axonbank1_1  | Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.eventsourcing.eventstore.EventStorageEngine]: Factory method 'eventStorageEngine' threw exception; nested exception is java.lang.NullPointerException
axonbank1_1  | 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	... 100 common frames omitted
axonbank1_1  | Caused by: java.lang.NullPointerException: null
axonbank1_1  | 	at org.axonframework.spring.config.AxonConfiguration.getComponent(AxonConfiguration.java:97) ~[axon-spring-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.axonframework.config.Configuration.getComponent(Configuration.java:114) ~[axon-core-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.axonframework.boot.autoconfig.JpaAutoConfiguration.eventStorageEngine(JpaAutoConfiguration.java:57) ~[axon-spring-boot-autoconfigure-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.axonframework.boot.autoconfig.JpaAutoConfiguration$$EnhancerBySpringCGLIB$$a327403f.CGLIB$eventStorageEngine$4(<generated>) ~[axon-spring-boot-autoconfigure-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.axonframework.boot.autoconfig.JpaAutoConfiguration$$EnhancerBySpringCGLIB$$a327403f$$FastClassBySpringCGLIB$$3590bee2.invoke(<generated>) ~[axon-spring-boot-autoconfigure-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	at org.axonframework.boot.autoconfig.JpaAutoConfiguration$$EnhancerBySpringCGLIB$$a327403f.eventStorageEngine(<generated>) ~[axon-spring-boot-autoconfigure-3.0.4.jar!/:3.0.4]
axonbank1_1  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
axonbank1_1  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
axonbank1_1  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
axonbank1_1  | 	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
axonbank1_1  | 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
axonbank1_1  | 	... 101 common frames omitted

Configure to use the JacksonSerializer

Hi!

One simple question: I was just playing around and tried to use Json to serialize everything instead of the default XML.
I tried to add this to AxonConfig-Class:

    @Bean
    public Serializer serializer() {
        return new JacksonSerializer();
    }

I can see that a JacksonSerializer serializer-Bean is created when running as a docker Container.
But the events in the MySql DB are still encoded as XML. Any hints?

Thx,
Dirk

Sonarcloud test coverage

Hello,
I noticed the project is on Sonarcloud and has zero test coverage although tests are present.
Is it a bug?

Changes to Write model are not reflected on Frontend

I have tried to extend this example by adding a "delete bank account" feature. (Ok the name is misleading, I just zero the balance)
I do set the balanceInCents in the BankAccount Aggregate to 0 by using an eventHandler. This should be quite simple and straight forward. When I now do following actions :

  1. Create bank account
  2. Deposit 3
  3. Delete account
  4. Deposit 5

Expected result in Frontend would be to have 5 as the balance displayed.
By using Logs on the BankAccount Aggregate I do see that the actual balance is 5.
Since the read model uses it's own EventHandlers to calculate the balance again instead of 5 I get displayed a balance of 8.

I am trying to learn to use the axon framework with this simple example, but it just confuses me.
There is something wrong with this code and I can't quite put my finger on it since I am new to axon.

I don't see the point in implementing my business logic of "delete" (or "reset the balance to 0") multiple times. Can someone more experienced please elaborate on this ?

Error starting ApplicationContext

Just cloned repo after build, Application can't start-up

  • with command: mvn -pl web spring-boot:run
Caused by: java.lang.IllegalArgumentException: Aggregate BankAccount has not been configured
	at org.axonframework.config.DefaultConfigurer$ConfigurationImpl.repository(DefaultConfigurer.java:332) ~[axon-core-3.0.4.jar:3.0.4]
	at org.axonframework.spring.config.AxonConfiguration.repository(AxonConfiguration.java:92) ~[axon-spring-3.0.4.jar:3.0.4]
	at org.axonframework.samples.bank.config.AxonConfig.bankAccountCommandHandler(AxonConfig.java:42) ~[classes/:na]
	at org.axonframework.samples.bank.config.AxonConfig$$EnhancerBySpringCGLIB$$14b293c5.CGLIB$bankAccountCommandHandler$0(<generated>) ~[classes/:na]
	at org.axonframework.samples.bank.config.AxonConfig$$EnhancerBySpringCGLIB$$14b293c5$$FastClassBySpringCGLIB$$ecb53cf1.invoke(<generated>) ~[classes/:na]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.7.RELEASE.jar:4.3.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
	at org.axonframework.samples.bank.config.AxonConfig$$EnhancerBySpringCGLIB$$14b293c5.bankAccountCommandHandler(<generated>) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
  • with: java -jar web/target/axon-bank-web-0.0.1-SNAPSHOT.jar
Caused by: java.lang.NullPointerException: null
	at org.axonframework.spring.config.AxonConfiguration.getComponent(AxonConfiguration.java:97) ~[axon-spring-3.0.4.jar!/:3.0.4]
	at org.axonframework.config.Configuration.getComponent(Configuration.java:114) ~[axon-core-3.0.4.jar!/:3.0.4]
	at org.axonframework.boot.autoconfig.JpaAutoConfiguration.eventStorageEngine(JpaAutoConfiguration.java:57) ~[axon-spring-boot-autoconfigure-3.0.4.jar!/:3.0.4]
	at org.axonframework.boot.autoconfig.JpaAutoConfiguration$$EnhancerBySpringCGLIB$$e7318512.CGLIB$eventStorageEngine$5(<generated>) ~[axon-spring-boot-autoconfigure-3.0.4.jar!/:3.0.4]
	at org.axonframework.boot.autoconfig.JpaAutoConfiguration$$EnhancerBySpringCGLIB$$e7318512$$FastClassBySpringCGLIB$$aa108eca.invoke(<generated>) ~[axon-spring-boot-autoconfigure-3.0.4.jar!/:3.0.4]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
	at org.axonframework.boot.autoconfig.JpaAutoConfiguration$$EnhancerBySpringCGLIB$$e7318512.eventStorageEngine(<generated>) ~[axon-spring-boot-autoconfigure-3.0.4.jar!/:3.0.4]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]

$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.17.04.1-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

Using Axon/CQRS-ES as full architecture

Hi

I am working on converting an existing application to CQRS design using Spring and Axon in this effort. Initially I started with below link following webinar and it all makes sense. It seems as if I can split my whole application into command and read and then have separate java processes. The web part is taking care of responding to client which in my case is apollo server running graphql.

AxonBank

I also came across below sample, which is very similar to AxonBank example, with 3 additional microservices for discovery, config and gateway. This also does not try to centralize web into one java process, instead read and write REST requests reach to separate java processes.
Axon microservice sampler

Finally I came across this article which says that cqrs should not be full architecture and only saga should be aggregates. I think this means that from AxonBank example, BankAccount does not qualify to be an aggregate here and only BankTransfer since later is a saga. Also will SOA in below quote qualify to be same as microservices ? If we structure CQRS around microservices, then each microservice will have their own query/core counterparts ..So that means 5 microservices will have doubled ie 10 further sub processes for read/write each.
http://udidahan.com/2011/04/22/when-to-avoid-cqrs/

Here’s the strongest indication I can give you to know that you’re doing CQRS correctly: Your aggregate roots are sagas.
Also, CQRS should not be your top-level architectural pattern – that would be SOA.
CQRS, if used at all, would be used inside a service boundary only.

There is also this reference where it seems saga is the usecase cited for CQRS
http://joshlong.com/jl/blogPost/an-email-on-distributed-state.html

The microservice only knows about the data in its domain, of course, so we need to solve the problem of composing data from different sources in a transactional way. CQRS is a logical fit here, especially with event sourcing.

In my case, existing application is fairly big with around 200 entities and there are definite bounded contexts inside it like posts, groups, profile, jobs, settings, payment, accounts, forums etc.. Would you prefer structuring java processes in the way AxonBank does or the microservice-sampler approach or the way last 2 citations ?

Sorry if I am asking the obvious but found this bit confusing since I started working on CQRS conversion.

Switch to axon 3.0 final release

I noticed some compile errors when switching to latest, seems like some dependencies and test tools changed from RC to RELEASE.
Would be nice to have the example reflect the final version.

Reproduce: switch version to 3.0 in pom.xml, fix errors

Issue while compiling the application

I am getting the following error when I run "mvn clean install -X"

[INFO] Axon Bank .......................................... SUCCESS [ 0.270 s]
[INFO] Axon Bank - Core API ............................... FAILURE [ 1.596 s]
[INFO] Axon Bank - Core ................................... SKIPPED
[INFO] Axon Bank - Query .................................. SKIPPED
[INFO] Axon Bank - Web .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.212 s
[INFO] Finished at: 2020-09-09T14:25:11Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project axon-bank-core-api: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
[ERROR]

Read-only repository?

I've read the Axon documentation and looked at all provided sample projects, especially this one but one thing is still bothering me and is not explained as far as I see:

It is my understanding that in Axon you perform queries against a read database which represents the materialized view, e.g. a H2 that contains the latest BankAccount JPA entity. However if you have a Spring repository, e.g. JpaRepository<BankAccount, Long>, you also have the save-method which should only be used for commands. Shouldn't you split the repository into a read-only and write-only repository?

Could someone also point me the documentation what how Axon works with this repository? Because for an unitiated developer it looks like a "normal" JPA repository, i.e. the entity seems mutable and always up to date but from a theoretical perspective I expect an immutable entity in state 0 where a projection is created by applying all events, does this happen in the background?

What would happen if I update the entity with JpaRepository#save but not the aggregate? Will they be out of sync?

It seems that we have two sources of truth in this case, which shouldn't be the case theoretically.

Local version not working with actual version.

mvn clean install phases are ok, but when i try to run the code in local mode, an exception:

`$ java -jar web/target/axon-bank-web-0.0.1-SNAPSHOT.jar
2019-01-17 12:41:47.505 INFO 69024 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@293a5bf6: startup date [Thu Jan 17 12:41:47 CET 2019]; root of context hierarchy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/Users/aironman/axonFramework/AxonBank/web/target/axon-bank-web-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/spring-core-4.3.7.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2019-01-17 12:41:47.831 INFO 69024 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-01-17 12:41:47.888 INFO 69024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$42d6272c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' |
| .__|| ||| |_, | / / / /
=========|
|==============|/=////
:: Spring Boot :: (v1.5.2.RELEASE)

2019-01-17 12:41:48.390 INFO 69024 --- [ main] o.a.samples.bank.AxonBankApplication : No active profile set, falling back to default profiles: default
2019-01-17 12:41:48.408 INFO 69024 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1ec9bd38: startup date [Thu Jan 17 12:41:48 CET 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@293a5bf6
2019-01-17 12:41:50.003 WARN 69024 --- [ main] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2019-01-17 12:41:50.179 INFO 69024 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=0905423c-c623-3889-8d7f-b5ad564e3e67
2019-01-17 12:41:50.220 INFO 69024 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-01-17 12:41:50.380 INFO 69024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$26bc242f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-17 12:41:50.440 INFO 69024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '__axon-parameter-resolver-factory' of type [org.axonframework.spring.config.ApplicationContextLookupParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-17 12:41:50.441 INFO 69024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean '__axon-parameter-resolver-factory' of type [org.axonframework.messaging.annotation.MultiParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-17 12:41:50.447 INFO 69024 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$42d6272c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-17 12:41:50.718 INFO 69024 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2019-01-17 12:41:50.732 INFO 69024 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2019-01-17 12:41:50.733 INFO 69024 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.11
2019-01-17 12:41:50.823 INFO 69024 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-01-17 12:41:50.823 INFO 69024 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2415 ms
2019-01-17 12:41:51.158 INFO 69024 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2019-01-17 12:41:51.160 INFO 69024 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'webServlet' to [/h2-console/]
2019-01-17 12:41:51.164 INFO 69024 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/
]
2019-01-17 12:41:51.164 INFO 69024 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/]
2019-01-17 12:41:51.165 INFO 69024 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/
]
2019-01-17 12:41:51.165 INFO 69024 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2019-01-17 12:41:51.853 INFO 69024 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2019-01-17 12:41:51.874 INFO 69024 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2019-01-17 12:41:52.002 INFO 69024 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.12.Final}
2019-01-17 12:41:52.003 INFO 69024 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2019-01-17 12:41:52.005 INFO 69024 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2019-01-17 12:41:52.032 WARN 69024 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
2019-01-17 12:41:52.033 INFO 69024 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
2019-01-17 12:41:52.234 INFO 69024 --- [ main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-01-17 12:41:52.244 ERROR 69024 --- [ main] o.s.boot.SpringApplication : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]
at org.axonframework.samples.bank.AxonBankApplication.main(AxonBankApplication.java:26) [classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at org.hibernate.boot.spi.XmlMappingBinderAccess.(XmlMappingBinderAccess.java:43) ~[hibernate-core-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.boot.MetadataSources.(MetadataSources.java:87) ~[hibernate-core-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:179) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:149) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:54) ~[spring-orm-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353) ~[spring-orm-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:370) ~[spring-orm-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:359) ~[spring-orm-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ~[spring-beans-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]
... 24 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566) ~[na:na]
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94) ~[axon-bank-web-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[na:na]
... 34 common frames omitted
`

How to create a unique user?

if i have a aggregate User ,How to ensure its uniqueness when I am dealing with command?
import userQuerySide repository into userCommandSide ?

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.