axon

AxonFramework简介

你。 提交于 2020-04-26 15:35:58
Axon是一个轻量级框架,能够帮助开发者通过在架构层面构建可扩展和可伸缩的应用。(注:以DDD面向领域驱动设计为基础的CQRS框架) Axon Framework背景、发展简史 随着时间的发展,软件的需求也在不断增长。公司都希望自己的(web)应用程序和自身业务共同发展。这就意味着不仅仅是工程和代码变得更复杂,也意味着功能不断地新增、更改和移除。它令人沮丧的是,一个看似易于实现的功能,却要求开发团队改动整个应用程 序。此外,如今的web程序的目标是针对潜在的数十亿用户,这便使可伸缩性成了必要的条件。 虽然有很多的应用和框架围绕着可扩展性问题进行处理,例如GigaSpaces(类似Microsoft Azure) 和 Terracotta(分布式缓存线性扩展平台),它们都存在着一个根本的缺陷。他们通过要求开发人员在开发应用时,使用分层体系架构,来试图解决可扩展性问题。在某些情况下,他们甚至会阻止或严格限制使用一个真正的领域模型,强迫所有领域逻辑都放到服务中。虽然可以很快地构建一个应用程序,最终,这种做法将导致复杂性的增加和开发速度减慢。 命令查询职责分离(CQRS)模式解决了这些问题,大幅改变了应用程序的架构。CQRS不是将分离的逻辑分到不同的层 ,逻辑的分离是以改变应用程序的状态或查询为依据。这意味着,执行命令(行为有可能更改应用程序的状态)和查询应用程序数据是由不同的组件执行

Axon参考指南 - 3.命令处理 - Aggregate(聚合)

岁酱吖の 提交于 2020-03-02 17:21:59
简述 在本章中,我们将更详细地介绍Axon应用程序中处理和调度命令的过程。这里将涉及诸如聚合建模,外部命令处理程序,命令分派和测试之类的主题。 1. Aggregate 基本使用 聚合是一个常规对象,其中包含状态和更改该状态的方法。创建Aggregate对象时,您实际上是在创建“ Aggregate Root”,通常带有整个Aggregate的名称。出于此描述的目的,将使用“礼品卡”域,这使我们将GiftCard作为汇总(根)。默认情况下,Axon将您的聚合配置为“基于事件的”聚合(如此处所述)。此后,我们的基本GiftCard聚合结构将重点关注事件采购方法: import org . axonframework . commandhandling . CommandHandler ; import org . axonframework . eventsourcing . EventSourcingHandler ; import org . axonframework . modelling . command . AggregateIdentifier ; import static org . axonframework . modelling . command . AggregateLifecycle . apply ; public class GiftCard {

Can I use both standard repositories and event Sourcing repositories in axonframework?

家住魔仙堡 提交于 2020-01-05 04:32:04
问题 I developed a couple of E-Commerce sites, I noticed the axonframework recently. I'm considering how to implement an new E-Commerce site with axonframework. I mean to use standard repositories to persist aggregates(in our case, they are orders) simply, but we also need the order history for review purpose. I wonder if we can use event Sourcing repositories to persist all event on an order to implement order history or not. Questions: Can I use both standard repositories and event Sourcing

Setting up Mongo Extension for Axon Framework on spring boot

好久不见. 提交于 2020-01-05 04:00:06
问题 So at first I added a properties file with: spring.data.mongodb.uri=mongodb://axon:axon@aurl:27017/axonframework which works but I was forced to use axonframework as db name because it is what was created in my mongo db. Now controlling the db name and other details isn't an option in this case, so I went and checked around and found the following: @configuration public class AxonConfiguration { @Value("${mongo.host:127.0.0.1}") private String mongoHost; @Value("${mongo.port:27017}") private

Is there any specific way for Axon migration from 2.4.3 version to 3.1.1

邮差的信 提交于 2020-01-02 10:13:28
问题 I am new to axon and doing migration from Axon 2.4.3 to 3.1.1 but I am not able to find any migration guide which is available for other version? Can you please share your experience on how to do the same. I am facing a lot problem, some classes have been removed, some packages have been changed. For some classes I am even not able to find replacements, so please help me with some suggestion. If there is a guide for same please provide me with link of that. Thanks in Advance Acctually I am

Axon & CompletableFuture

那年仲夏 提交于 2019-12-24 12:12:48
问题 I've faced with problems when i try to use CompletableFuture with Axon. For example: CompletableFuture future = CompletableFuture.supplyAsync(() -> { log.info("Start processing target: {}", target.toString()); return new Event(); }, threadPool); future.thenAcceptAsync(event -> { log.info("Send Event"); AggregateLifecycle.apply(event); }, currentExecutor); in thenAcceptAsync - AggregateLifecycle.apply(event) has unexpected behavior. Some of my @EventSourcingHandler handlers start handling

Axon 4: EventSourcingHandler not triggered when applying event from a different thread

喜欢而已 提交于 2019-12-24 03:42:28
问题 I've encountered a little issue with command handling in Axon 4. Let say I have an aggregate that need to call an external service when handling a command. The external service uses an asynchronous client (vertx tcp client + rxjava), so the response is given in a different thread than the one that created the aggregate instance. I want to apply an event given the result of my service, but it does not work because the AggregateLifecycle.apply() call is on a different thread... How can I

Real life experience with the Axon Framework [closed]

戏子无情 提交于 2019-12-20 08:39:31
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 10 months ago . As part of researching CQRS for use with a project, I ran across the Axon Framework, and I was wondering if anyone has any real life experience with it. Just to be clear, I'm asking about the framework, not CQRS as an architectural pattern. My project already uses Spring

Design Commands And Events while Handling External partner with Axon 4

末鹿安然 提交于 2019-12-13 13:25:33
问题 This is a question related to designing command handling with Axon 4. Let say I've a domain that model the concept of a Payment . The actual payment will be done by an external Partner. I want to track it in my system via the following events: a Payment Request Was Issued followed by either Partner Agreed the Payment or Partner Declined the Payment . Every events issued by the command should be enrolled in the same database transaction. What would be the best practice to actually call my

Axon message receive but event handler not call

喜夏-厌秋 提交于 2019-12-13 09:07:45
问题 Axon message receives but event handler not call. I am trying to implement the event sourcing in both the side with tow different queue. My First Queue is test and the Second one is testdemo I have two separate application running on the same server. User Management Wallet Management I have implemented the event sourcing from User Management to wallet management. and it is working fine. Now I am trying to implement the wallet management to UserManagement, Means that When I will publish the