axon_logo.png

Axon framework is rapidly moving to the 1.0 release. Just a few days a go Allard released the first release candidate. You can find more information in his blog item: First release candidate available. In the past I have created multiple samples that some aspect of axon or the integration of axon with other technologies.

In this blog post I want to go over all the axon samples that I have created, some of them together with Allard. I will explain the intentions of all the samples and the technologies used.

If you are missing samples, have good ideas, please let me know and I’ll see what I can do.


Company HR

Sources https://github.com/jettro/CompanyHr
Goal Show the integration of Axon and the Google app engine
Technologies Google app engine, Objectify, Spring security, Spring mvc
Blogposts http://blog.jteam.nl/2011/01/04/deploying-a-cqrs-application-based-on-the-axon-framework-on-google-app-engine/

I started this sample to create a google app engine based event store. In the beginning I had to do some tweaks to the axon framework to make it work. Mostly serialization issues. By now Allard has created solutions to all these problems. The only thing I have to change is the XStream class. Some of the default Converters do not work on google app engine and the reflection provider needs to be the pure java one.

The code contains three classes: EventEntry, GaeEventStore, and GaeSnapshotter. Persistence is taken care of using the low level data api of google app engine. The sample also needs a query side implementation. For the query side I have chosen to use Objectify. If you want more details about the implementation check the source code or the mentioned blog post.

The security is taken care of using spring security. Again of course integrated with google app engine. Most important ideas for the implementation are taken from the samples from the spring security project.

Axon address book sample

Sources http://code.google.com/p/axonframework/source/browse/trunk#trunk%2Fsample%2Faddressbook
Goal Show the basic usage of the axon framework with some front end technologies. At the moment two complete implementations are available: Flex using Parsley and normal web using spring mvc. A third client is in progress using the Vaadin project. All clients use the same app component with the command and query classes.
Technologies Spring mvc, Parsley (flex), Vaadin
Blogposts http://www.gridshore.nl/2010/02/25/creating-a-sample-for-axon-using-flex-and-parsley/
http://www.gridshore.nl/2010/04/11/attaching-flex-to-axon-using-the-new-axon-commandbus/

This is the sample that comes with Axon. It is a nice introduction into some of the options that Axon has. The flex client shows a nice integration with the event listeners and a very generic component to send commands to the command bus. The only catch with this sample is that the used libraries are slightly outdated. I’ll try to do some upgrades in the nearby future.

The spring-mvc client is one of those clients a lot of people will create or at least something similar.

The client that is under construction is the Vaadin client. A very nice way of creating business oriented applications. More on this sample will follow in a later blog post.

Axon address book Grails

Sources https://github.com/jettro/axon-addressbook-grails
Goal I wanted to show there is more to axon than java. Oke, groovy is also java, but it is perfectly possible to use Axon with groovy. In this sample I use grails to create the query side of the application and use the commands and events created in groovy to do the other part. The sample is the same usecase as the one coming with axon.
Technologies Grails
Blogposts http://www.gridshore.nl/2010/04/08/use-grails-and-axon-to-create-a-cqrs-application-part-i/
http://www.gridshore.nl/2010/04/16/use-grails-and-axon-to-create-a-cqrs-application-part-ii/

In this sample I show the groovy side of Axon. To be honest, I am not sure if this would be something that I would recommend. But it does work. I do like the query side with grails. I think doing the commands and events might be better of in plain java. Although omitting the getters and setters for all the duplicate properties is still nice in groovy. Maybe using a bit more type safeness could help.

Axon trader

Sources https://github.com/jettro/Axon-trader
Goal Create an application that does more than the very basic stuff. The application will be the basis for load testing axon and in the future to do some remoting with axon as well. The sample is used to create the MongoDB Axon EventStore.
Technologies MongoDB, Spring-mvc, Gradle
Blogposts http://www.gridshore.nl/2010/09/20/learning-mongodb/
http://www.gridshore.nl/2010/09/27/still-learning-mongodb/

This project was not meant to be using to much advanced technologies outside of MongoDB. During the creation of the sample we developed the MongoDB implementation of the Axon EventStore. By now this implementation is in the Axon core. This sample is mostly interesting for the domain. The trader engine is simplistic, but it works.

Concluding

As you can see there are some samples available. Others are also publishing samples, some googling will help you out in finding them.

If you feel that you are missing something in the samples please let me know or try the Axon mailing list.

Tagged on: