I am new to Hangfire and would like to seek advice/guidance to a scenario I have.
I have a requirement to periodically (like every minute) call an external web service. This web service will return a list of transactions (sometimes as high as 200),
which I am expected to iterate through and save each item in my database, after a series of validations. After succesful save in database, i will make another call to
another werb service per each transaction.
From the little I have read about Hangfire, I have two approaches in mind
Approach 1 - I can handle
Schedule a recurring job that will call a method. This method will handle the process of making a call to the external web service, iterate through the list of transactions,
save in database and call second web service for each transaction.
Approach 2 - Don’t know how to do, so will need guidance
Schedule a recurring job that will call a method. This method will make a call to external web service, iterate through the list of transactions and CREATE A FIRE-AND-FORGET
JOB FOR EACH TRANSACTION dynamically. Each dynamic job will save the transaction in database and call second web service, after which it’s disposed/forgotten
Please advice me on which approach is best