Skip to content

Commit fc9a905

Browse files
committed
fixed max messages member
1 parent 43e84e1 commit fc9a905

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.agorapulse.worker.WorkerConfiguration;
2222
import com.agorapulse.worker.annotation.Consumes;
2323
import com.agorapulse.worker.annotation.FixedRate;
24+
import com.agorapulse.worker.annotation.Fork;
2425
import com.agorapulse.worker.annotation.Job;
2526
import io.micronaut.context.annotation.AliasFor;
2627
import jakarta.inject.Named;
@@ -34,6 +35,7 @@
3435

3536
@Documented
3637
@Consumes
38+
@Fork(JobConfiguration.ConsumerQueueConfiguration.DEFAULT_MAX_MESSAGES)
3739
@FixedRate("20s")
3840
@Retention(RUNTIME)
3941
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@@ -61,7 +63,8 @@
6163
/**
6264
* @return the maximum of messages consumed in a single run, defaults to {@link JobConfiguration.ConsumerQueueConfiguration#DEFAULT_MAX_MESSAGES}
6365
*/
64-
@AliasFor(annotation = Consumes.class, member = "value")
66+
@AliasFor(annotation = Fork.class, member = "value")
67+
@AliasFor(annotation = Consumes.class, member = "maxMessages")
6568
int maxMessages() default JobConfiguration.ConsumerQueueConfiguration.DEFAULT_MAX_MESSAGES;
6669

6770
/**

0 commit comments

Comments
 (0)