From c0ecae25feecccc338cb7943586a1fde7ac648fb Mon Sep 17 00:00:00 2001 From: Sonu Kumar Date: Wed, 2 Sep 2020 13:15:01 +0530 Subject: [PATCH] Updated readme file --- README.md | 30 ++++++++++--------- .../exception/LockCanNotBeAcquired.java | 4 +++ .../rqueue/listener/RqueueExecutor.java | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4e2bf8ac..6dafce7c 100644 --- a/README.md +++ b/README.md @@ -13,20 +13,22 @@ ## Features -* A message can be delayed for an arbitrary period or delivered immediately. -* Multiple messages can be consumed in parallel by different workers. -* Message delivery: It's guaranteed that a message is consumed **at least once**. (Message would be consumed by a worker more than once due to the failure in the underlying worker/restart-process etc, otherwise exactly one delivery) -* Support Redis cluster -* Queue metrics -* Different Redis connection for application and worker -* Web interface for queue management and queue statistics -* Automatic message serialization and deserialization -* Queue concurrency -* Group level queue priority(weighted and strict) -* Sub queue priority(weighted and strict) -* Task execution back off, exponential and fixed back off (default fixed back off) -* Callbacks for different actions -* Events 1. Bootstrap event 2. Task execution event. +* **Message Scheduling** : A message can be scheduled for any arbitrary period +* **Competing Consumers** multiple messages can be consumed in parallel by different workers. +* **Message delivery**: It's guaranteed that a message is consumed **at least once**. (Message would be consumed by a worker more than once due to the failure in the underlying worker/restart-process etc, otherwise exactly one delivery) +* **Redis cluster** : Redis cluster can be used with driver. +* **Metrics** : In flight messages, waiting for consumption and delayed messages +* **Web interface**: a web interface to manage a queue and queue insights including latency +* **Automatic message serialization and deserialization** +* **Concurrency**: Concurrency of any queue can be configured +* **Queue Priority** : + * Group level queue priority(weighted and strict) + * Sub queue priority(weighted and strict) +* **Execution Backoff** : Exponential and fixed back off (default fixed back off) +* **Callbacks** : Callbacks for dead letter queue, discard etc +* **Events** 1. Bootstrap event 2. Task execution event. +* **Unique message** : Unique message processing for a queue based on the message id +* Separate Redis connection for Rqueue ## Getting Started diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/LockCanNotBeAcquired.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/LockCanNotBeAcquired.java index 93f0e99f..5336be39 100644 --- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/LockCanNotBeAcquired.java +++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/LockCanNotBeAcquired.java @@ -16,6 +16,10 @@ package com.github.sonus21.rqueue.exception; +/** + * Whenever a Redis lock can not be acuired due to some other is holding lock then this error would + * be thrown. The application should retry once this error occurs. + */ public class LockCanNotBeAcquired extends RuntimeException { private static final long serialVersionUID = 598739372785907190L; diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueExecutor.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueExecutor.java index c2c42672..34920fe3 100644 --- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueExecutor.java +++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueExecutor.java @@ -172,7 +172,7 @@ void start() { long maxProcessingTime = getMaxProcessingTime(); long startTime = System.currentTimeMillis(); int retryCount = getRetryCount(); - int attempt = 0; + int attempt = 1; ExecutionStatus status; try { do {