Ho to schedule events for years

38 views
Skip to first unread message

Pietro Marrone

unread,
Nov 30, 2016, 5:14:24 PM11/30/16
to Axon Framework Users
Our application handle of business contracts.
This contract last several years 3 or 5.

Now we like to have some notification some time before that date say 1 month before (let say to send email to admin user and populate the view of todo list for renewal) and when the date arrives the contract a should be marked as expired so change the aggregate state.

Now is the sagas with event scheduler the right choice?
Or I'm on wrong path?

Thanks

Allard Buijze

unread,
Nov 30, 2016, 5:35:18 PM11/30/16
to Axon Framework Users
If it's only for triggering an action, I would try to avoid Sagas. They will do the trick, but they also add more complexity than this task seems to ask for.

You can use the EventScheduler from any component. It doesn't need to be a Saga.
So what you could do is create a singleton Event Handler class that schedules events in the far future, but also listens to the events published by the scheduler and sends the appropriate commands.

If the scheduling involves more process logic, then a Saga may be a viable option.

Cheers,

Allard

--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pietro Marrone

unread,
Nov 30, 2016, 6:27:20 PM11/30/16
to Axon Framework Users
Wow, great I didn't know.
Sure I'll do like this.

Thank for quick reply.

Reply all
Reply to author
Forward
0 new messages