I have a case where I need to use Scheduled. This schedule will execute this method every 30 min, so the method is
@Transactional
public void processEnable()
throws Exception
{
try
{
}
catch (Exception e)
{
logger.warn("[Enable] [STATUS] - ERROR ");
logger.warn("[Enable] [EXCEPTION] " + e.getMessage(), e);
throw e;
}
}
and I want to get this method to execute for 30 min
and i am doing this with that.
@Scheduled(cron = "0 0 1-2 * * *")
public void Enable()
{
try
{
Service.Enable();
}
catch (Exception e)
{
e.printStackTrace();
}
}
but the problem is how to get the parameter here, is my first time, in fact, using @Scheduled and I don't know how it works or how can I get the parameter from the user so I can get this method works each 30 min.
I am having no idea to get the parameter I want.