Cleaned up cronjob
This commit is contained in:
parent
9b35054423
commit
41b144a3b9
1 changed files with 0 additions and 19 deletions
|
|
@ -1,14 +1,12 @@
|
|||
package se.saasta.rabbitmq.producer;
|
||||
|
||||
import io.quarkus.scheduler.Scheduled;
|
||||
import io.quarkus.scheduler.ScheduledExecution;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import org.eclipse.microprofile.reactive.messaging.Channel;
|
||||
import org.eclipse.microprofile.reactive.messaging.Emitter;
|
||||
import se.saasta.rabbitmq.model.AkkaData;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@ApplicationScoped
|
||||
public class UpdateAktorCronJob {
|
||||
|
|
@ -16,23 +14,6 @@ public class UpdateAktorCronJob {
|
|||
@Channel("akka")
|
||||
Emitter<AkkaData> emitter;
|
||||
|
||||
private AtomicInteger counter = new AtomicInteger();
|
||||
|
||||
public int get() {
|
||||
return counter.get();
|
||||
}
|
||||
|
||||
@Scheduled(every = "10s")
|
||||
void increment() {
|
||||
counter.incrementAndGet();
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 15 10 * * ?")
|
||||
void cronJob(ScheduledExecution execution) {
|
||||
counter.incrementAndGet();
|
||||
System.out.println(execution.getScheduledFireTime());
|
||||
}
|
||||
|
||||
@Scheduled(cron = "{cron.expr}")
|
||||
void cronJobWithExpressionInConfig() {
|
||||
AkkaData akkaData = new AkkaData();
|
||||
|
|
|
|||
Loading…
Reference in a new issue