- Command failures are often transient (e.g. service down ->
NoHandlerForCommandException
). As such, it makes sense to introduce the concept of aRetryScheduler
- Problem: retrying commands is not always a safe operation, as the initial "failed" command may have produced side
effects
- this is particularly common in case of
timeout (
COMMAND_TIMEOUT("AXONIQ-4002", Status.CANCELLED, HttpStatus.GATEWAY_TIMEOUT)
)
- this is particularly common in case of
timeout (
- To enable safe retries, the CH must be idempotent
- Some operations are inherently idempotent (e.g.
markDeleted()
) - Many operations are not inherently idempotent (e.g.
DepositMoney
) - All operations can be made idempotent by adding a uniquifier (see Building on Quicksand by Pat Helland)
- Some operations are inherently idempotent (e.g.
ApplicationIT
demonstrates that, in the absence of a uniquifier, the use of aRetryScheduler
can cause side effects to be triggered multiple times.- the test fails when
using
org.axonframework:axon-spring-boot-starter:4.6.2
(git checkout e2ff3a8e523888da98f4f4d749fcc985d2229cd5 && mvn verify
) - the test still fails after
replacing
org.axonframework:axon-spring-boot-starter:4.6.2
(git checkout 605660d798036ea3ccbbd4c35e6c4620840262c3 && mvn verify
) withcom.github.jvanheesch.AxonFramework:axon-spring-boot-starter:8de17c281d890a4598d640c788aad4557c7ef787
- the test passes after adding
idempotent = true
to@Aggregate
forBankAccount
aggregate (git checkout 804754d41a78fdfb41880b30a16ddccca8cbe8e3 && mvn verify
)
- the test fails when
using
axon-command-idempotency's Introduction
axon-command-idempotency's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.