Axon 2.2 Released

Axon 2.2 has been released. It contains a number of new features and improvements.

The biggest newcomer is the JDBC Event Store. Similar to the JPA Event Store, it allows you to store Events in a SQL database. However, it uses ‘plain’ JDBC to do so. This implementation allows you to tweak the SQL statements executed against the database, to allow for implementation-specific performance improvements. Special thanks go out to Kristian Rosenvold for doing the bulk of the work.

Another cool new feature is the possibility to put @CommandHandler annotations on entities in an Aggregate other than the aggregate root. By annotating fields containing these entities with @CommandHandlingMember, you tell Axon to forward (some) commands to the entity referenced in that field. This will allow you to remove all the pass-through handlers from your aggregate root, and have Axon deal with the forwarding for you.

This version now also contains an EventTemplate class, which makes it easier to publish events to the EventBus. The main difference is that you don’t need to wrap your object in an EventMessage anymore. The other extra you get, is that you can automatically attach certain headers to the Events, by registering them with the template instance.

Event upcasting has become yet more powerful. Occasionally, you may want to upcast an event to one of several options. By implementing the ExtendedUpcaster interface, you can base the type of Event to upcast to on the contents of the Event to upcast.

Axon now comes with a Serializer implementation based on Jackson. This serializer will generate ‘proper’ JSON strings representing your events. By placing annotations on your Event’s contructor, you don’t even need to change your Event’s API at all.

Last, but definitely not least, is the ability to force timestamps to UTC before storing them. This ability on the Event Store allows you to prevent sorting issues when running an application in a multi-timezone environment. Note that this also counts for countries that apply daylight savings time. For backwards compatibility reasons, this feature is turned off by default. You can switch it on in your Event Store implementation.

For more details, check out the release notes.

Leave a Comment (0) ↓