我正在使用akka-quartz-scheduler来安排触发Akka演员的工作。
示例代码:
ActorSystem system = ActorSystem.create("ActorSystem", config);
QuartzSchedulerExtensionscheduler =
(QuartzSchedulerExtension) QuartzSchedulerExtension.get(system);
ActorRef jobActor =
system.actorOf(FromConfig.getInstance().props(Props.create(JobActor.class)), "job_actor");
scheduler.schedule("Job1", jobActor, "Job1");
获得以下错误:
Exception in thread "main" java.lang.IllegalArgumentException: No matching quartz configuration found for schedule 'Job1'
这是否意味着对于每项工作,我都需要在配置中添加计划?有没有一种程序化的方法呢?