I am using the current Axon 2.0-SNAPSHOT on a greenfield application. My question is about design using the new constructs in v2.0 vs what was available in 1.4.
I have an external service that my aggregate must communicate for validation. The service is accessed via AMQP calls. Using Greg Young’s advice I am keeping the external exits from my “domain bubble” to a minimum by wrapping these calls in domain specific service class.
Once such method is quite simply:
boolean isAccountActive(String accountCode);
What if the service is unavailable? I came into the aggregate from a command call. Axon 2 no longer has a non-domain event that can be applied from the aggregate. So do I need to pass along the EventBus so that I can fire a “system event”? Is there an exception adapter that could initiate a system event that could start a saga to continue trying to process this request?
As I write this I wonder if I should flip my domain sideways a bit. Maybe my aggregate could keep a date of the last time it validated the account. I could start a saga with the job to validate and when successful to fire a command of “SuccessfulAccountValidationCommand”.
Your insight would be greatly appreciated.