Show Menu
Cheatography

Axon Framework - Application Configuration Cheat Sheet (DRAFT) by

Configuration for Axon Applications

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Axon Framework - Applic­ation Config­uration Guide

The config­uration guide covers the possible config­uration areas for your Axon applic­ation when you utilize the Axon Server (Standard Edition / Enterprise Edition)


- Axon Applic­ation General Config­uration
- Axon Applic­ation Serial­ization Config­uration
- Axon Applic­ation Event Processing Config­uration


Each individual list is split into two sections. The first section gives a list of all the possible config­ura­tions. The second section gives a recomm­end­ation against the config­ura­tions to enable develo­per­s/o­per­ato­rs/­adm­ini­str­ators to optimize their Axon Applic­ation Deployment

Axon Applic­ation General Config­uration

A group of properties that allows easy general config­uration for Axon Framework based Applic­ations that connect to an Axon Server (Standard / Enterprise / SaaS)

Parameter List (prefix = axon.a­xon­ser­ver)

Name
Descri­ption
enabled
Determines automatic config­uration of the Axon Server connector
servers
Comma Separated list of Axon Server instances in format {{hostname}} or {{hostname}}:{{grpc_port}}.
clientId
Unique identifier for the Axon Applic­ation as it registers with an Axon Server
compon­entName
Name for the Axon Applic­ation
token
Token for access control to the Axon Server
context
Operat­ional Bounded Context for the Axon Applic­ation
sslEnabled
Flag to enable SSL connec­tivity to the Axon Server
certFile
Certif­icate file for SSL
initia­lNr­OfP­ermits
Initial number of permits that an Axon Applic­ation can accept for message streams (events, commands, queries)
nrOfNe­wPe­rmits
Additional number of permits that an Axon Applic­ation can accept for message streams (events, commands, queries)
newPer­mit­sTh­reshold
Threshold at which applic­ation sends new permits to server
comman­dTh­reads
Number of threads executing commands
queryT­hreads
Number of threads executing queries
proces­sor­sNo­tif­ica­tio­nRate
Interval (in ms.) applic­ation sends status updates on event processors to AxonServer
proces­sor­sNo­tif­ica­tio­nIn­iti­alDelay
Initial delay (in ms.) before applic­ation sends first status update on event processors to AxonServer
eventC­ipher
Used to encrypt and decrypt events and snapshots
keepAl­ive­Timeout
Timeout (in ms) for keep alive requests
keepAl­iveTime
Interval (in ms) for keep alive requests, 0 is keep-alive disabled. Defaults to {@code 1000}.
snapsh­otP­refetch
Value indicating the maximum number of Aggregate snapshots which will be retrieved.
maxMes­sag­eSize
Grpc max inbound message size
commit­Timeout
Timeout (in millis­econds) to wait for response on commit
disabl­eEv­ent­Bla­ckl­isting
Flag that allows blackl­isting of Event types to be disabled
maxGrp­cBu­ffe­red­Mes­sages
The number of messages that may be in-transit on the networ­k/grpc level when streaming data from the server
comman­dLo­adF­actor
It represents the fixed value of load factor sent to Axon Server for any command's subscr­iption if no specific implem­ent­ation of Comman­dLo­adF­act­orP­rovider is configured
connec­tTi­meout
Represents the maximum time in millis­econds a request for the initial Axon Server connection may last

Value Recomm­end­ations (prefix = "­axo­n.a­xon­ser­ver­")

Name
Default Value
Recomm­end­ation
enabled
true
Recomm­ended to retain the default value. Also this value kicks in only when using automatic config­uration via Applic­ation Containers
servers
localhost
In Axon SE, the single node hostname needs to be supplied. In Axon EE (cluster deploy­ment), input the name of the designated leader among the nodes.
compon­entName
{{spring.application.name}}
Recomm­ended to provide a business name for the Axon applic­ation. Multiple instances of the same Axon applic­ation will have the same applic­ation name
clientid
{{ManagementFactory.getRuntimeMXBean().getName()}}
The client identifier for an Axon applic­ation has to be unique for every instance of that Axon applic­ation connecting to an Axon Server. Recomm­ended to retain the default value as it creates a unique identifier
token
None
Needs to be provided if the Axon Server deployment (SE/EE) has enabled access control restri­ctions. Recomm­ended to be enforced for non-de­vel­opment enviro­nments. If you are using the SaaS edition, this token needs to be supplied always
context
"­def­aul­t"
This applies only to Axon EE. If supplied, each context will have its own set of files (stored in a separate direct­ory). Recomm­ended to be implem­ented in case multiple applic­ations connecting to the same event store have data protection policies. Each context may have a different master in an Axon Server cluster. The context name must start with a letter and followed by a combin­ation of letters, digits, hyphens and unders­cores.
sslEnabled
false
Needs to be enabled (true) for non-de­vel­opment enviro­nments as a hardening measure to enforce TLS connec­tions to the Axon Server
certFile
None
In case SSL is enabled, this would need to be supplied as the public key
initia­lNr­OfP­ermits
5000
Retain default value
nrOfNe­wPe­rmits
null
Retain default value. A value of null, 0, and negative values will have the client (i.e. the Axon applic­ation) request the number of permits required to get from the "­new­-Pe­rmi­ts-­Thr­esh­old­" or "­ini­tia­l-n­r-o­f-p­erm­its­".
newPer­mit­sTh­reshold
null
Retain default value. A value of null, 0, and negative values will have the threshold set to 50% of "­ini­tia­l-n­r-o­f-p­erm­its­"
comman­dTh­reads
10
Retain default value. Has perfor­mance impact if changed.
queryT­hreads
10
Retain default value. Has perfor­mance impact if changed.
proces­sor­sNo­tif­ica­tio­nRate
10
Retain default value
proces­sor­sNo­tif­ica­tio­nIn­iti­alDelay
5000
Retain default value
eventC­ipher
EventC­iph­er#­Eve­ntC­ipher()
Default encryption algorithm used is AES/CB­C/P­KCS­5Pa­dding which should suffice
keepAl­ive­Timeout
5000
Retain default value
keepAl­iveTime
1000
Retain default value
snapsh­otP­refetch
1
Retain default value
maxMes­sag­eSize
0 (Keeps default value for grpc size)
Retain default value
commit­Timeout
10000
Retain default value
disabl­eEv­ent­Bla­ckl­isting
false
Retain default value. Has high perfor­mance impact if enabled.
maxGrp­cBu­ffe­red­Mes­sages
500
Retain default value
comman­dLo­adF­actor
100
Retain default value
connec­tTi­meout
5000
Retain default value

Axon Serial­ization Config­uration

A group of properties that allows easy config­uration of the serial­izers used for different types of objects that Axon needs to serialize. This config­uration controls the serial­ization of the following types of Axon Messages (Event­s/C­omm­and­s/Q­ueries) and Axon objects (Sagas­/Tokens and Snapshots)

Parameter List (prefix = axon.s­eri­alizer)

Name
Descri­ption
events
The Event Serializer is used to serialize the payload and meta data of Event Messages only as they are stored in the event store and published.
messages
The Message Serializer is used to serialize the payload and meta-data of all messages and, where relevant, their return values. Commands, Queries and Events (only if no Event Serializer is config­ured), but also the Command Result and Query Responses are serialized using this serializer
general
The General Serializer is used to serialize the rest of the objects, such as Tracki­ngT­okens, Saga state, Snapshot Events and all other data that needs to be serial­ized, but is not expected to be shared with other systems.

Parameter Recomm­end­ations

Name
Default Value
Recomm­end­ation
events
XSTREAM
Recomm­ended to change to JACKSON (JSON Output) which provides a nice compact serialized form which is optimal in case you have events being stored for a long duration of time. This however, requires adherence to the conven­tions enforced by JACKSON
messages
XSTREAM
Retain the default value. For high perfor­mance requir­ements recomm­ended to build Custom Conver­ter­s/S­eri­ali­zation mechanism
general
XSTREAM
Retain the default value.
Note 1 : The following serial­izers are available -> DEFAULT (XSTREAM) , JACKSON and JAVA
Note 2 : There is an implicit ordering between the config­urable serializer -> Event Serializer -> Message Serializer -> Default Serializer
Note 3 : The following criteria of the Axon Messag­es/­Objects needs to be considered while choosing any of the available serial­ization mechanisms or custom­izing it -> Duration of storage / Size / Sharea­blity / Compaction / Intero­pab­ility.

Axon Event Processing Config­uration List

A group of properties that allows for the config­­ur­ation of Event Processors within an Axon Applic­ation.

List (prefix = axon.e­ven­tha­ndl­ing.pr­oce­ssors)

Name
Descri­ption
{{name}}.mode
<<T­BD>>
{{name}}.source
<<T­BD>>
{{name}}.initialSegmentCount
<<T­BD>>
{{name}}.tokenClaimInterval
<<T­BD>>
{{name}}.threadCount
<<T­BD>>
{{name}}.batchSize
<<T­BD>>
{{name}}.sequencingPolicy
<<T­BD>>
{{name}}.tokenClaimIntervalTimeUnit
<<T­BD>>
Note 1 : {{name}} is the name of the Event Processor within the Axon applic­ation.

Parameter Recomm­end­ations

Name
Default Value
Recomm­end­ation
{{name}}.mode
<<T­BD>>
<<T­BD>>
{{name}}.source
<<T­BD>>
<<T­BD>>
{{name}}.initialSegmentCount
<<T­BD>>
<<T­BD>>
{{name}}.tokenClaimInterval
<<T­BD>>
<<T­BD>>
{{name}}.threadCount
<<T­BD>>
<<T­BD>>
{{name}}.batchSize
<<T­BD>>
<<T­BD>>
{{name}}.sequencingPolicy
<<T­BD>>
<<T­BD>>
{{name}}.tokenClaimIntervalTimeUnit
<<T­BD>>
<<T­BD>>