This is a question about what is suitable in a particular situation. I have heard that you may want to avoid long running calls in an @Aggregate @CommandHandler because it will lock the Aggregate for longer. I wanted to understand the specific disadvantages of locking the aggregate.
We are handling payments and expect a sequence of commands -
retrieve payment result after payment has been made in the browser
receive notification about a payment result if it was still pending when retrieving the result
Now this is pretty much sequential for a specific aggregate instance, and I don’t think locking a specific aggregate instance would be a big problem here, am I missing something? Do you foresee any problems with having the calls to the payment provider inside the @CommandHandler?