レポート実行コマンドを処理しているレポートランナー集計があります。集約にはターゲット識別子があり、両方のコマンドには同じターゲット識別子があります。Axonエラー:java.lang.IllegalArgumentException:作業ユニット(Unit of Work)に既に同じ識別子を持つ集計があります
次のエラーに
java.lang.IllegalArgumentExceptionが取得:作業ユニットは、すでにorg.axonframework.common.Assert.isTrue(Assert.java:54)で同じ識別子 との集計を持っています〜[axon-core-3.0.6.jar:3.0.6] at org.axonframework.commandhandling.model.AbstractRepository.newInstance(AbstractRepository.java:84)〜[axon-core-3.0.6.jar:3.0。 6] at org.axonframework.commandhandling.AggregateAnnotationCommandHandler $ AggregateConstructorCommandHandler.handle(AggregateAnnotationCommandHandler.java:181)〜[axon-core-3.0.6.jar:3.0.6] at org.axonframework.commandhand ling.AggregateAnnotationCommandHandler $ AggregateConstructorCommandHandler.handle(AggregateAnnotationCommandHandler.java:170)〜[axon-core-3.0.6.jar:3.0.6] at org.axonframework.commandhandling.AggregateAnnotationCommandHandler.handle(AggregateAnnotationCommandHandler.java:148)〜[ axon-core-3.0.6.jar:3.0.6] at org.axonframework.commandhandling.AggregateAnnotationCommandHandler.handle(AggregateAnnotationCommandHandler.java:40)〜[axon-core-3.0.6.jar:3.0.6]
何か
public class ExecuteReportsAggregate
{
@AggregateIdentifier
private String reportId;
// Command Handler and Even Source Handlers
}
実行レポートコマンド
のような報告書は、コマンドを実行し@Value
public class ExecuteReportCommand
{
@TargetAggregateIdentifier
String reportId;
}
@Value
public class ReportExecutedCommand
{
// @TargetAggregateIdentifier
private String reportId;
}
春ブーツがこの
public static void main(String[] args)
{
ConfigurableApplicationContext config = SpringApplication.run(SsmpPreopenCommand.class, args);
CommandBus commandBus = config.getBean(CommandBus.class);
commandBus.dispatch(GenericCommandMessage.asCommandMessage(new ExecuteReportCommand("12345",
"asdfasdf Errors", "/home/teo", new ServiceCredentials())));
// commandBus.dispatch(GenericCommandMessage.asCommandMessage(new
// ReportExecutedCommand("12345")));
}
を参照してください。 – Allard