Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

holixon/axon-cdi

Repository files navigation

Axon CDI

travis codecov

Quality Gate Sonar Rating Sonar Debt Ration Sonar Reliability

This CDI Extension to use AxonFramework 3.x in CDI container environments (Application server or SE).

Minimal tested version is:

  • AxonFramwork 3.1
  • CDI 1.1

Usage

Currently the artifact is not (yet) released to Maven Central and you have to build it locally, running from command line:

  ./mvnw clean install

At some point of time, we will pass this project to AxonIQ and they will release the extension to Maven Central. If you have created the artifact locally, simply add the following dependency in your Apache Maven pom.xml:

  <dependency>
    <groupId>org.axonframework.extension</groupId>
    <artifactId>axon-cdi</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </dependency>

AxonFramework Building Blocks

Axon CDI provides easy access to most important AxonFramework building blocks. These can simply be injected in your code:

  • CommandBus
  • CommandGateway
  • EventBus
  • Serializer
  • Configuration

Aggregates

Similar to Axon Spring, you can define aggregate roots by putting a simple annotation org.axonframework.cdi.stereotype.Aggregate on your class. It will be automatically collected by the CDI container and registered (Don't forget the beans.xml).

Examples

Please have a look on examples in example folder.

DeltaSpike

The deltaspike example shows the usage in a Java SE environment (without an application server).

Wildfly

The wildfly example demonstrates the usage inside of a WildFly application server. To start the server try

cd examples/wildfly
mvn wildfly:run wildfly:deploy

Wildfly Swarm

The wildfly-swarm example demonstrates the usage inside of a WildFly Swarm container. This means packaging the application together with the required parts of the application server into a single JAR similiar to SpringBoot approach. To start the server try

cd examples/wildfly-swarm
mvn wildfly-swarm:run

Advanced usage

Usage of JPA event store inside container

If you want to use the JPA based event store inside of a container (e.g. JBoss or Wildfly), you have to configure the following facilities:

  • EntityManagerProvider
  • TransactionManager
  • EventStorageEngine
  • TokenStore

Contributing

Issues

https://github.com/holisticon/axon-cdi/issues

Contributors

License

APACHE-2.0

About

CDI Extension to use AxonFramework 3.x in Container Environments

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published