Triggering an NServiceBus Saga Handler after and Extended Period of Inactivity

StackOverflow https://stackoverflow.com/questions/15935579

  •  03-04-2022
  •  | 
  •  

سؤال

I have a long running business process (weeks, not minutes). The start of the process is triggered by a user's action. The problem I have is that the next step in the saga will come from one of two places, either a second user interaction, or if after a period of say 1 week the the user hasn't performed an action then another point in the saga should be triggered.

Is a saga the correct mechanism to use in this business process? If so, how is this achieved? If a saga isn't suitable for this task, is there a better mechanism than simply executing nightly batch jobs against a database? My aversion to running a nightly batch job is simply the size of the database table I'd have to hit to query for the next point in the saga.

هل كانت مفيدة؟

المحلول

Yes - sagas are designed for exactly these scenarios.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top