Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用一个聚合来处理来自多个 sagas 的命令。不幸的是,如果 saga 在聚合忙于处理另一个命令时发送命令,则该命令会丢失,并会在日志中写入 AggregateNotFoundException。
我可以为每个 saga 使用一个聚合,但我想知道是否可以为所有 saga 使用一个聚合。
在 Axon 中,命令处理程序对命令的来源不感兴趣。因此,无论是多个 Sagas 发送命令,还是只有一个源,都无关紧要。
我认为这里的问题更多地与竞争条件有关。如果命令导致 AggregateNotFoundException,则意味着尚未处理创建聚合的命令。
最有可能的是,模型/设计中存在问题,导致出现这些竞争条件。但是,为了能够判断这一点,我需要更多关于你的设计以及你试图用它来实现什么的信息。