I’m considering to utlize Axon for the new application.
Basically the logic is following:
the application receives data (about 1MB) via REST API
it stores the received data in AWS S3 bucket
processes the data
saves the result in ASW S3 bucket
sends the the processed data via SOAP into external system for processing
periodically polling the external system for result of processing
Since the flow involves external services I want to be able to retry if communication with external system fails.
Is Saga suitable for this scenario? Or would you reccommend another aproach?
I think what your sketching can be regarded as a ‘complex business transaction’ with a notion of time tied into it, were you potentially want to perform counter action if the intended operation fails.
This is exactly what a Saga should be able to help you with.
Hence I’d say yes, I’d try out a Saga solution to your problem to model this complex business transaction.
there are apparently two ways to read your question. When it comes to implementing the “workflow process”, yes, a Saga could be a suitable mechanism, as Steven points out. However, if you’re just looking for a solution to retry calls to external services, a Saga would be overkill. In that case, an (event) handler that invokes external services, in combination with an error handler on a (tracking) event processor should suffice.
thank you for your replies. It’s good to know that there is someone listening for developers questions
Allard, actually I want both. I have already created simple proof of concept using saga and it seems that it is what I was looking for.
Now I’m only struggling with how to configure tracking processor. Could you please help?
I’m using Spring Boot 2.0.5, Axon 3.4 and JPA persistence using PostgreSQL.
Cheers
Pavel
Dne středa 7. listopadu 2018 14:56:22 UTC+1 Allard Buijze napsal(a):
To configure a tracking event processor, you could very harshly just switch the default to TrackingEventProcessor with the EventProcessingConfiguration#usingTrackingProcessors().
Note that in Axon 4, the default is the Tracking Event Processor.
If you’re still in the early development phase, I’d suggest to upgrade your project to Axon 4.