Download - Webinar - Whats new in Axon 3
What’s new in Axon 3
Presented by:
Allard Buijze
CTO of Trifork Amsterdam, Founder of Axon Framework
A brief history of time
A quick replay of Axon’s Event Store
A quick replay of Axon’s Event Store
Applied DDD to a project
Model clearly helped reduce accidental complexity
However, ‘management reports’ polluted the model, increasing complexity
2009 2010 2011 2012 2013 2014 2015 2016
A quick replay of Axon’s Event Store
Investigation of ‘Distributed Domain Driven Design’
Event Driven Architecture & Event Sourcing
2009 2010 2011 2012 2013 2014 2015 2016
2009 2010 2011 2012 2013 2014 2015 2016
A quick replay of Axon’s Event Store
3rd party notified that Axon 0.4 is used in production
November 2010 - two projects for Axon (0.6)
Bridge Big
GeriMedica Ysis
2009 2010 2011 2012 2013 2014 2015 2016
A quick replay of Axon’s Event Store
Axon 1.0 released in April
Basic infrastructure components
Annotation based event sourcing
Event class hierarchy
Event Store stored event context in same blob as event data
No distinction between payload and metadata
2009 2010 2011 2012 2013 2014 2015 2016
A quick replay of Axon’s Event Store
Axon 2.0 released in January.
Message API
Scalability components
Aggregate hierarchy
Difficult replays
Infrastructure complexity
2009 2010 2011 2012 2013 2014 2015 2016
A quick replay of Axon’s Event Store
Axon 3 development / design started
better API’s
simplify infrastructure
more modeling freedom
easy replays
2009 2010 2011 2012 2013 2014 2015 2016
A quick replay of Axon’s Event Store
You’re here!!
Axon 3 available for public testing: 3.0-M1
We need your feedback!
2009 2010 2011 2012 2013 2014 2015 2016
Why Axon 3?
Community feedback & lessons learned
Changing application ecosystem
Monoliths vs Microservices
Lightweight vs Application Servers
Fast release cycles
Major API changes
What’s new in 3.0?
Java 8
What’s new in 3.0?
Java 8
javax.time instead of JodaTime
Functional interfaces & lambda’s
Streams
It’s all about messaging!
What’s new in 3.0?
Messaging & Unit of Work
Unit of Work spans a single message
Removed distinction between Command & Event
Register lifecycle handlers using lambda’s
UoW attaches Correlation Data to all generated messages
Attaching UoW-specific resources
Event Store = Event Bus + Event Sourcing
What’s new in 3.0?
Event Sourcing in Axon 2.x
Event Sourcing in Axon 3.x
Event Store acts as an Event Bus
Removes the need for an Event Bus when using Event Sourcing
Better consistency guarantees
Consumers can tail the Event Store
Event Processors
What’s new in 3.0?
Event Processors
Replacement for (Event Handler) Cluster
Technical component for processing events
1st level citizen in API
Subscribing (push) or streaming (pull)
Streaming processors store token of last processed event
Replay is a matter of deleting that token
Spring JavaConfig
What’s new in 3.0?
Dropping Spring XML namespace support
Spring promotes JavaConfig
XML fear / disgust
JavaConfig allows for fluent config API
Now: API’s are JavaConfig friendlier
Soon: Spring Annotation autoconfiguration
Dropping Spring XML namespace support
Models don’t need to extend Axon classes
What’s new in 3.0?
AggregateRoot in Axon 2.x
public class MyAggregateRoot extends AnnotatedAggregateRoot {
@AggregateIdentifier
private String id;
@CommandHandler
public void handle(MyCommand command) {
apply(new MyEvent(…));
}
}
AggregateRoot in Axon 3.x
import static ….AggregateLifeCycle.apply;
public class MyAggregateRoot {
@AggregateIdentifier
private String id;
@CommandHandler
public void handle(MyCommand command) {
apply(new MyEvent(…));
}
}
Easier to model multi-entity aggregates
What’s new in 3.0?
Aggregate member in Axon 2.x
public class MyAggregateRoot extends AnnotatedAggregateRoot {
@CommandHandlingMember
@EventHandlingMember
private MyEntity entity;
}
public class MyEntity extends AnnotatedEntity {
@CommandHandler
public void handle(MyCommand command) {
apply(new MyEvent(…));
}
}
Aggregate member collection in Axon 2.x
public class MyAggregateRoot extends AnnotatedAggregateRoot {
@CommandHandlingMemberCollection(entityId=“…”, commandTargetProperty=“…”)
@EventHandlingMember
private List<MyEntity> entities;
}
public class MyEntity extends AnnotatedEntity {
@CommandHandler
public void handle(MyCommand command) {
apply(new MyEvent(…));
}
}
Aggregate member in Axon 3.x
public class MyAggregateRoot {
@AggregateMember
private MyEntity entity;
}
public class MyEntity {
@CommandHandler
public void handle(MyCommand command) {
apply(new MyEvent(…));
}
}
Aggregate member collection in Axon 3.x
public class MyAggregateRoot {
@AggregateMember
private List<MyEntity> entities;
}
public class MyEntity {
@EntityId
private String myEntityId;
@CommandHandler
public void handle(MyCommand command) {
apply(new MyEvent(…));
}
}
Note: Default setting assumes command contains “myEntityId” property
Meta-annotations
What’s new in 3.0?
Meta annotations
@Retention(Retention.RUNTIME)
@Target(…)
@CommandHandler
public @interface MyCommandHandler {
}
Handler enhancers
What’s new in 3.0?
Handler enhancers
…
@CommandHandler
public @interface SecuredCommandHandler { … }
public class SecuredCommandHandlerDefinition implements
HandlerEnhancerDefinition {
… wrapHandler(MessageHandler<T> original) { … }
}
Monitoring & Metrics
What’s new in 3.0?
Monitoring & Metrics
Axon components provide API to expose metrics
Processing times
Success/Failure rates
Capacity
Default implementation using DropWizard Metrics
Upcaster API
What’s new in 3.0?
Upcaster API
No longer limited to events
Upcaster gets more contextual information
Lazy vs eager – everything is lazy
Support for stateful upcasters
Reactive API
There’s more coming…
More plans for the future
Axon 3.x, moving on…
Annotation based message interceptors
Annotation based upcasters
Deadline API
Simpler conflict detection and resolution
Enhancement of DistributedCommandBus
Spring based auto-configuration
QueryBus
But wait… there’s more
Even more plans for the future
Axon Platform
Running Axon at scale
Axon Platform
Single monitoring endpoint / dashboard for all nodes
Cluster-wide latency measurement
Message tracing
Processing analytics
Auto-configuration through master node
Message routing settings
Load balancing
High Performance Event Store
Other activities
Other things to get you going…
Other activities
Support
Consultancy & development
Developer Support
Architecture & code reviews
Modelling workshops
Implement custom components
Training
Amsterdam, July 18-19
On-site
Acknowledgements
René de Waele
Steven van Beelen
Marijn van Zelst
Koen Lavooij
Joris van der Kallen
and over 40 other committers
Are you already one of them?
Enjoy!
Thank you
Questions & Answers
What’s new in Axon 3
Allard Buijze
CTO of Trifork Amsterdam, Founder of Axon Framework
T: +31 20 486 20 36
W: www.axonframework.org
@allardbz / @axonframework
This presentation has been recorded and you will receive the link shortly