Skip to content

Commit

Permalink
Merge pull request #54 from agorapulse/fix/waiting-time-as-queue-name
Browse files Browse the repository at this point in the history
fixed wrong alias for QueueConsumer waitingTime
  • Loading branch information
musketyr authored Dec 10, 2024
2 parents b258abb + ffe18cf commit d183f2b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
public @interface QueueConsumer {

/**
* Allows to override the default name of the job which is <code>JobClassName</code> if there is only one executable
* method (e.g. job definition) in the class or <code>JobClassName-methodName</code> if there is more then one executable method in the class.
* <p>
* Either the job name specified here or the default name is converted using {@link io.micronaut.core.naming.NameUtils#hyphenate(String)}.
*
* @return the name of the job used for configuration
*/
@AliasFor(annotation = Named.class, member = "value")
String name() default "";

/**
* @return the name of the work queue to consume items from
*/
Expand All @@ -57,7 +68,7 @@
* The time to wait for the next message to be available and also the time to wait for the next run.
* @return the maximum waiting time as duration string
*/
@AliasFor(annotation = Consumes.class, member = "value")
@AliasFor(annotation = Consumes.class, member = "waitingTime")
@AliasFor(annotation = FixedRate.class, member = "value")
String waitingTime() default "";

Expand All @@ -70,7 +81,10 @@
int maxMessages() default JobConfiguration.ConsumerQueueConfiguration.DEFAULT_MAX_MESSAGES;

/**
* @return The name of a {@link Named} bean that is a
* The name of the task executor to use to execute the job. If default value is usd then new scheduled executor
* is created for each job with the number of threads equal to the fork value.
*
* @return The name of a {@link jakarta.inject.Named} bean that is a
* {@link java.util.concurrent.ScheduledExecutorService} to use to schedule the task
*/
@AliasFor(annotation = Job.class, member = "scheduler")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.agorapulse.worker.annotation.Job;
import com.agorapulse.worker.annotation.Produces;
import io.micronaut.context.annotation.AliasFor;
import jakarta.inject.Named;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down Expand Up @@ -50,6 +51,12 @@
*
* @return the name of the job used for configuration
*/
@AliasFor(annotation = Named.class, member = "value")
String name() default "";

/**
* @return the name of the work queue to produce items to
*/
@AliasFor(annotation = Produces.class, member = "value")
String value() default "";

Expand Down

0 comments on commit d183f2b

Please sign in to comment.