0

We have put in place an account service management : its reponsability is to let a user register is account, confirm his email, etc...

We have put also in place a process layer that is reponsible to notify the user when his account is altered.

The notifications are done by a notification service that is decoupled from our account service and that notify the user based on an event mechanism. Here is an overview of the principle : enter image description here

As a new requirement, our customer wants us now to send , for any notification, a reminder every 2 hours to the user. For example if the account is not yet confirmed , we will send the user a notification by email askin him to confirm his account 2 hours later... The team in charger of the UserNotification service, think that it's not their responsability to handle this because they have a stateless process and do not know about the account status for example. So they ask that the account management service should raise an event "AccountStillNotConfirmed" to ask for the notification every two hours :

enter image description here

The alternative is to make the usernotification statefull, or at less make it asks the account service for the list of "not yet confirm account" every two hours and send a notification if needed. The event "AccountStillNotConfirmed" seems odd to me. I am in search of the most clean way to tackle this problem.

which architecture would be preferable for you and why ? Is there another alternative way to staisfy our customer need?

1 Answer 1

2

The business responsibility should be in the service that controls the object, i.e. if the Account Management Service is the place where the user confirms his account (probably by clicking on some link or the like), the additional timer should also live there.

As you are in an event based environment, probably the simplest solution would be, that the account management service, when it needs a confirmation, should do the following:

  • send a message to notification service ("please confirm account")
  • send a message to itself with a two hours delivery delay (or alternatively to a timer service), "check confirmation"

Upon receiving the "check confirmation" message, check whether the account still needs to be confirmed, if yes, repeat the same as above.

(And on a personal note: as an end-user I'd be really annoyed by having a reminder every 2 hours. That's about 30 message from Friday afternoon until I get back to work on Monday morning.)

2
  • I was thinking that the Account Management Service was not concerned by user notification so I was thinking to modify the notification service. For example, we haven't got the "please confirm account" message for now : there is a process layer which detect the account created event and send a notfication to ask the user for a confirmation... Thank for the delayed message strategy...
    – Dypso
    Commented Apr 7, 2020 at 9:37
  • 2
    As far as I can see, the account management service is the one that wants to have the confirmation and receives the confirmation. Whether the means to that is an email-notification, a postal letter, a personal visit at the customer's is just a technical detail.
    – mtj
    Commented Apr 7, 2020 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.