1
我正在使用Spring調度程序和JMS,哪一個會是更好的調度方法。哪一個選擇Betweeen Spring調度器和JMS?它們之間的區別
@Service
public class ScheduledProcessor implements Processor {
private final AtomicInteger counter = new AtomicInteger();
@Autowired
private Worker worker;
@Scheduled(fixedDelay = 30000)
public void process() {
System.out.println("processing next 10 at " + new Date());
for (int i = 0; i < 10; i++) {
worker.work(counter.incrementAndGet());
}
}
}