Triggering scheduled commands on all Aggregate instances

What would be a good way to implement a recurring trigger (say at a given time of the day every day) command for all Aggregate instances?

Example, Lets say that we have 10,000 Loan Aggregate instances and at the end of every day we want to trigger an Interest Accrual command on each Loan.

Please could you suggest how this could be implemented using the Axon framework?

Check this Creating an Interval Scheduler with Quartz and Sagas. It explains how to create a deadline cronjob to issue commands at a given time period.

Although for this specific case this might not be needed, the interest rate sounds predictable to calculate, and bulk command calculation at end of the day might be overkill…

Computation of an interest (aka interest accrual) is usually done at end of the day, because during the day the Loan A/c may be subject to “movements” i.e., the Loan a/c holder may pay a lump sum amount towards the loan or extend the borrowed amount further (if allowed to do so).

My question relates to a scenario where you have many Aggregate instances that need to execute a time scheduled operation on a daily basis?

Yes i understand that triggering such an operation at the same time for 10000 Aggregate instances might be a “processing load” spike, hence wish to know if there is a better way to deal with triggering a scheduled operation/command on several aggregate instances in a time scheduled manner?

The only idea that I have right now is that you could try spreading load by adding some random time offset per aggregate. So all triggers fire within for example within one hour instead of in the same second.