0
votes

What is the best way to import an excel file (or do mass insert) containing entities using the Axon Framework ? Should we use a command with the excel file as a byte array, then parse the file in the Aggregate and send them each line as an event ? or create an event the list of entities (but then how to update aggregates) ? or parse the excel file outside of the aggregate and then create command of each row ?

Thanks for help.

1

1 Answers

0
votes

it pretty much depends on what kind of Event is valuable for your business.

But in general, parsing the file outside of the Aggregate (this is not what the Aggregate is used for) and firing multiple commands (one for each line) would be my choice. In that case, you will have an Event on your EventStore for each line which will make it way more explicity about what happened. Also, important to note that in this case, your Events will be granular and not that big, which usually I see as a code smell =)

KR,