I am trying Spring Boot and think about scalabilty.
Lets say I have a component that does a job (e.g. checking for new mails). It is done by a scheduled method.
e.g.
@Component
public class MailMan
{
@Scheduled (fixedRateString = "5000")
private void run () throws Exception
{ //... }
}
Now the application gets a new customer. So the job has to be done twice.
How can I scale this component to exist or run twice?