Recently, I released Axon Framework 1.0. Instead of it being an opportunity to take a small break, things have gone into a higher gear instead. In this article, I give a sneak preview of what’s coming up in and around Axon Framework.


More test fixtures

Testing is obviously very important. Axon already has test fixtures to test your command handling components using an easy-to-use given-when-then fixture. But the command handling component is not the only component with potentially complex business logic.

Axon 1.1 will include a similar fixture for testing Sagas. The big difference between a Command Handler and a Saga is that the Saga responds to Events and takes decisions based on them. Quite often, the aspect of time is important. For example, if an invoice is not paid within 30 days, the Saga must send a command to cancel or block an Order. The Saga test fixture allows you to write code like this:

fixture.givenAggregate(orderAggregate).published(new OrderCreatedEvent())
       .andThenAggregate(invoice).published(new InvoiceSentEvent())

       .whenTimeElapses(Duration.standardDays(31))

       .expectDispatchedCommands(new BlockOrderCommand());

This allows you to write human-readable test that define what the behavior should be when certain things happen, or even when they don’t happen.

Work on these fixture is still in progress, but a sneak preview is available in the 1.1-SHAPSHOT version already. Look for the AnnotatedSagaTestFixture class, give it the class you want to test and you are ready to start testing.

Redis event store

Redis is a very nice and full-featured key-value store. Instead of values being plain blobs, Redis allows for lists, sets, maps (called hashes) and even ordered sets. There is also a pub/sub mechanism in place and the API supports the implementation of message queues.

All in all, this makes Redis a very nice candidate for an Event Store implementation. We have already spent some time investigating the API and the level of consistency guarantees that Redis can offer. They match very well with what one would expect from an Event Store. We’ll be spending some more time on it before we decide whether to implement a full-blown Event Store, or not.

Distributed command bus

Scalability is obviously one of the reasons to choose for CQRS. Having components that only work within a single JVM doesn’t really help. I have done a small proof-of-concept with a Distributed version of the Command Bus. So far, the results look really good.

This Command Bus implementation allows commands to be distributed over a cluster of machines for execution. Instead of blindly sending commands to random machines, it uses the Consistent Hashing algorithm to make sure that commands for the same Aggregate will end up on the same machine. If a machine drops, the load is taken over by the remaining machines. You can even –at runtime- add another machine to the cluster and have it take over some of the load. This means you can dynamically adapt your cluster size to meet the needs of that specific moment, without any single-point-of-failure.

The distributed command bus is still in the proof-of-concept phase, but work on the real version will start very soon. I will also build a small application that allows you to see it at work.

2-day “full-immersion” training

Spreading knowledge on CQRS and the Axon Framework has always been on the agenda. In the past few months, I have given suite a number of presentations and 1-day workshops. Although they are nice to do, there is too little time to really dive into the matter. That’s why I have decided to go for a 2-day training.

This two day training is a little different that what you’re used to. Instead of doing a training over 2 days from 9AM to 5PM, this training is 32 hours in a row. Okay, admitted, this includes a few hours of eating and sleeping as well. The training takes place in a hotel in the beautiful “Utrechse Heuvelrug” area in The Netherlands. It’s 2 days, all-in (overnight stay and meals). The idea behind this concept is that we’ll be able to really dive deep into the concepts and get to the bottom of things. So after dinner on the first day, there is time for coding as well as informal chatting at the hotel bar.

The training covers the basic concepts of DDD and CQRS, but also allows you to really get your hands dirty. The first training has been scheduled for June 23rd and 24th 2011. For more information about this training, visit the training page: http://www.jteam.nl/training/workshop/2-day-CQRS-and-Axon-Immersion-Training.html.

One thought on “Coming up in the Axon Framework

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>