webinar - whats new in axon 3

51
What’s new in Axon 3 Presented by: Allard Buijze CTO of Trifork Amsterdam, Founder of Axon Framework

Upload: allard-buijze

Post on 23-Jan-2018

1.457 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Webinar - Whats new in Axon 3

What’s new in Axon 3

Presented by:

Allard Buijze

CTO of Trifork Amsterdam, Founder of Axon Framework

Page 2: Webinar - Whats new in Axon 3

A brief history of time

A quick replay of Axon’s Event Store

Page 3: Webinar - Whats new in Axon 3

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

Page 4: Webinar - Whats new in Axon 3

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

Page 5: Webinar - Whats new in Axon 3

2009 2010 2011 2012 2013 2014 2015 2016

Page 6: Webinar - Whats new in Axon 3

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

Page 7: Webinar - Whats new in Axon 3

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

Page 8: Webinar - Whats new in Axon 3

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

Page 9: Webinar - Whats new in Axon 3

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

Page 10: Webinar - Whats new in Axon 3

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

Page 11: Webinar - Whats new in Axon 3

Why Axon 3?

Community feedback & lessons learned

Changing application ecosystem

Monoliths vs Microservices

Lightweight vs Application Servers

Fast release cycles

Major API changes

Page 12: Webinar - Whats new in Axon 3

What’s new in 3.0?

Page 13: Webinar - Whats new in Axon 3

Java 8

What’s new in 3.0?

Page 14: Webinar - Whats new in Axon 3

Java 8

javax.time instead of JodaTime

Functional interfaces & lambda’s

Streams

Page 15: Webinar - Whats new in Axon 3

It’s all about messaging!

What’s new in 3.0?

Page 16: Webinar - Whats new in Axon 3

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

Page 17: Webinar - Whats new in Axon 3

Event Store = Event Bus + Event Sourcing

What’s new in 3.0?

Page 18: Webinar - Whats new in Axon 3

Event Sourcing in Axon 2.x

Page 19: Webinar - Whats new in Axon 3

Event Sourcing in Axon 3.x

Page 20: Webinar - Whats new in Axon 3

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

Page 21: Webinar - Whats new in Axon 3

Event Processors

What’s new in 3.0?

Page 22: Webinar - Whats new in Axon 3

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

Page 23: Webinar - Whats new in Axon 3

Spring JavaConfig

What’s new in 3.0?

Page 24: Webinar - Whats new in Axon 3

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

Page 25: Webinar - Whats new in Axon 3

Dropping Spring XML namespace support

Page 26: Webinar - Whats new in Axon 3

Models don’t need to extend Axon classes

What’s new in 3.0?

Page 27: Webinar - Whats new in Axon 3

AggregateRoot in Axon 2.x

public class MyAggregateRoot extends AnnotatedAggregateRoot {

@AggregateIdentifier

private String id;

@CommandHandler

public void handle(MyCommand command) {

apply(new MyEvent(…));

}

}

Page 28: Webinar - Whats new in Axon 3

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(…));

}

}

Page 29: Webinar - Whats new in Axon 3

Easier to model multi-entity aggregates

What’s new in 3.0?

Page 30: Webinar - Whats new in Axon 3

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(…));

}

}

Page 31: Webinar - Whats new in Axon 3

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(…));

}

}

Page 32: Webinar - Whats new in Axon 3

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(…));

}

}

Page 33: Webinar - Whats new in Axon 3

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

Page 34: Webinar - Whats new in Axon 3

Meta-annotations

What’s new in 3.0?

Page 35: Webinar - Whats new in Axon 3

Meta annotations

@Retention(Retention.RUNTIME)

@Target(…)

@CommandHandler

public @interface MyCommandHandler {

}

Page 36: Webinar - Whats new in Axon 3

Handler enhancers

What’s new in 3.0?

Page 37: Webinar - Whats new in Axon 3

Handler enhancers

@CommandHandler

public @interface SecuredCommandHandler { … }

public class SecuredCommandHandlerDefinition implements

HandlerEnhancerDefinition {

… wrapHandler(MessageHandler<T> original) { … }

}

Page 38: Webinar - Whats new in Axon 3

Monitoring & Metrics

What’s new in 3.0?

Page 39: Webinar - Whats new in Axon 3

Monitoring & Metrics

Axon components provide API to expose metrics

Processing times

Success/Failure rates

Capacity

Default implementation using DropWizard Metrics

Page 40: Webinar - Whats new in Axon 3

Upcaster API

What’s new in 3.0?

Page 41: Webinar - Whats new in Axon 3

Upcaster API

No longer limited to events

Upcaster gets more contextual information

Lazy vs eager – everything is lazy

Support for stateful upcasters

Reactive API

Page 42: Webinar - Whats new in Axon 3

There’s more coming…

More plans for the future

Page 43: Webinar - Whats new in Axon 3

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

Page 44: Webinar - Whats new in Axon 3

But wait… there’s more

Even more plans for the future

Page 45: Webinar - Whats new in Axon 3

Axon Platform

Running Axon at scale

Page 46: Webinar - Whats new in Axon 3

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

Page 47: Webinar - Whats new in Axon 3

Other activities

Other things to get you going…

Page 48: Webinar - Whats new in Axon 3

Other activities

Support

Consultancy & development

Developer Support

Architecture & code reviews

Modelling workshops

Implement custom components

Training

Amsterdam, July 18-19

On-site

Page 49: Webinar - Whats new in Axon 3

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?

Page 50: Webinar - Whats new in Axon 3

Enjoy!

Thank you

Page 51: Webinar - Whats new in Axon 3

Questions & Answers

What’s new in Axon 3

Allard Buijze

CTO of Trifork Amsterdam, Founder of Axon Framework

E: [email protected]

T: +31 20 486 20 36

W: www.axonframework.org

@allardbz / @axonframework

This presentation has been recorded and you will receive the link shortly