Skip to content

Commit e360041

Browse files
committed
added scheduler to the QueueConsumer
1 parent d050d6c commit e360041

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libs/micronaut-worker/src/main/java/com/agorapulse/worker/convention/QueueConsumer.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
package com.agorapulse.worker.convention;
1919

2020
import com.agorapulse.worker.JobConfiguration;
21+
import com.agorapulse.worker.WorkerConfiguration;
2122
import com.agorapulse.worker.annotation.Consumes;
2223
import com.agorapulse.worker.annotation.FixedRate;
24+
import com.agorapulse.worker.annotation.Job;
2325
import io.micronaut.context.annotation.AliasFor;
26+
import jakarta.inject.Named;
2427

2528
import java.lang.annotation.Documented;
2629
import java.lang.annotation.ElementType;
@@ -61,4 +64,11 @@
6164
@AliasFor(annotation = Consumes.class, member = "value")
6265
int maxMessages() default JobConfiguration.ConsumerQueueConfiguration.DEFAULT_MAX_MESSAGES;
6366

67+
/**
68+
* @return The name of a {@link Named} bean that is a
69+
* {@link java.util.concurrent.ScheduledExecutorService} to use to schedule the task
70+
*/
71+
@AliasFor(annotation = Job.class, member = "scheduler")
72+
String scheduler() default WorkerConfiguration.DEFAULT_SCHEDULER;
73+
6474
}

0 commit comments

Comments
 (0)