diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml
index d8986797..233ef15e 100644
--- a/.github/workflows/pages.yaml
+++ b/.github/workflows/pages.yaml
@@ -10,9 +10,13 @@ on:
# Runs on pushes targeting the default branch
push:
branches: [ $default-branch ]
+ paths:
+ - "docs/**"
pull_request:
branches: [ 'main', '2.x' ]
types: [ opened ]
+ paths:
+ - "docs/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@@ -33,6 +37,9 @@ jobs:
# Build and Deploy job
build_and_deploy:
runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: docs
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -42,33 +49,20 @@ jobs:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
+ working-directory: '${{ github.workspace }}/docs'
+ - name: Setup Pages
+ id: pages
+ uses: actions/configure-pages@v4
- name: Bundle install in docs folder
- run: |
- cd docs
- bundle install
+ run: bundle install
- name: Build Jekyll site
- run: |
- cd docs
- bundle exec jekyll build --baseurl /rqueue
- mkdir -p _site # Ensure _site directory exists
+ run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- - name: Verify _site directory
- run: |
- cd docs
- ls -l _site
- name: Upload artifact
- # Automatically uploads an artifact from the './_site' directory by default
- uses: actions/upload-artifact@v2
+ uses: actions/upload-pages-artifact@v2
with:
- name: Jekyll site
- path: docs/_site
+ path: 'docs/_site/'
- name: Deploy to GitHub Pages
- uses: JamesIves/github-pages-deploy-action@4.1.4 # Replace with the appropriate deploy action
- with:
- branch: $default-branch
- folder: docs/_site
- cname: sonus21.github.io
- env:
- JEKYLL_ENV: production
- BASE_URL: /rqueue
\ No newline at end of file
+ id: deployment
+ uses: actions/deploy-pages@v3
\ No newline at end of file
diff --git a/docs/.ruby-version b/docs/.ruby-version
new file mode 100644
index 00000000..fd2a0186
--- /dev/null
+++ b/docs/.ruby-version
@@ -0,0 +1 @@
+3.1.0
diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock
index 4962bad0..df2b4403 100644
--- a/docs/Gemfile.lock
+++ b/docs/Gemfile.lock
@@ -92,6 +92,7 @@ GEM
PLATFORMS
arm64-darwin-21
+ arm64-darwin-23
x86_64-linux
DEPENDENCIES
diff --git a/docs/_includes/footer_custom.html b/docs/_includes/footer_custom.html
index 59fed928..78d1869e 100644
--- a/docs/_includes/footer_custom.html
+++ b/docs/_includes/footer_custom.html
@@ -1 +1 @@
-Copyright © 2019-{{ "now" | date: "%Y" }} Sonu Kumar. Distributed by an Apache 2.0 license.
+Copyright © 2019-{{ "now" | date: "%Y" }} Sonu Kumar. Distributed by an Apache 2.0 license. Build on {{ "now" | date:"%Y-%m-%d %H:%M" }}
diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md
index 7b47cc3e..3cb03d22 100644
--- a/docs/configuration/configuration.md
+++ b/docs/configuration/configuration.md
@@ -15,13 +15,6 @@ configuration or directly in the code.
{: .fs-6 .fw-300 }
-## Table of contents
-
-{: .no_toc .text-delta }
-
-1. TOC
- {:toc}
-
---
Apart from the basic configuration, Rqueue can be heavily customized, such as adjusting the number
of tasks executed concurrently. Additional configurations can be provided using
diff --git a/docs/configuration/retry-and-backoff.md b/docs/configuration/retry-and-backoff.md
index a2fad2b7..376058a4 100644
--- a/docs/configuration/retry-and-backoff.md
+++ b/docs/configuration/retry-and-backoff.md
@@ -18,8 +18,9 @@ the `SimpleRqueueListenerContainerFactory`. The default back-off time is 5 secon
In scenarios where you don't want Rqueue to retry failures, you can handle this in two ways:
-1. **Using `RqueueListener` Annotation**: Add exceptions to the `doNotRetry` list within
+- **Using `RqueueListener` Annotation**: Add exceptions to the `doNotRetry` list within
the `RqueueListener` annotation. This instructs Rqueue not to retry for specific exceptions.
+
```java
public class MessageListener{
@@ -30,7 +31,8 @@ public class MessageListener{
}
```
-2. **Returning `-2` from Execution Backoff Method**: Alternatively, you can return `-2` from the
+
+- **Returning `-1` from Execution Backoff Method**: Alternatively, you can return `-1` from the
execution backoff method. This signals Rqueue to stop any further retry attempts for the failed
message.
diff --git a/docs/dashboard.md b/docs/dashboard.md
index b845c6bd..11178e19 100644
--- a/docs/dashboard.md
+++ b/docs/dashboard.md
@@ -84,17 +84,21 @@ prefix: [http://localhost:8080/my-application/rqueue](http://localhost:8080/my-a
### Dashboard Screenshots
#### Latency Graph
+
[![Latency Graph](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/stats-graph.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/stats-graph.png)
#### Queue Statistics
+
[![Queue Statistics](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/queues.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/queues.png)
#### Tasks Waiting for Execution
+
[![Tasks Waiting for Execution](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/queue-explore.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/queue-explore.png)
#### Running Tasks
+
[![Running Tasks](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/running-tasks.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/running-tasks.png)
diff --git a/docs/index.md b/docs/index.md
index 45e64c8c..3d153c11 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -40,7 +40,7 @@ frameworks.
* **Queue Priority**: Supports both group-level and sub-queue level priorities.
* **Long Execution Jobs**: Check-in mechanism for long-running jobs.
* **Execution Backoff**: Supports exponential and fixed backoff strategies.
-* **Do not retry**: Supports do not retry exceptions.
+* **Do not retry**: Supports do not retry strategy.
* **Middleware**: Allows integration of middleware to intercept messages before processing.
* **Callbacks**: Supports callbacks for handling dead letter queues and discarding messages.
* **Events**: Provides bootstrap and task execution events.
@@ -304,6 +304,7 @@ the [GitHub repository][Rqueue repo] or contact the maintainers directly.
{: .fs-5 }
Rqueue is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/sonus21/rqueue/blob/master/LICENSE) file for more details.
+
[Rqueue Docs]: https://github.com/sonus21/rqueue/wiki
[Boot Maven Central]: https://search.maven.org/artifact/com.github.sonus21/rqueue-spring-boot-starter
[Maven Central]: https://search.maven.org/artifact/com.github.sonus21/rqueue-spring
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/PostProcessingHandler.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/PostProcessingHandler.java
index 38bb5cb8..07dad13b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/PostProcessingHandler.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/PostProcessingHandler.java
@@ -81,9 +81,6 @@ void handle(JobImpl job,
case IGNORED:
handleIgnoredMessage(job, failureCount);
break;
- case FAILED_IGNORED:
- handleFailedIgnoredMessage(job, failureCount);
- break;
case OLD_MESSAGE:
handleOldMessage(job, job.getRqueueMessage());
break;
@@ -283,7 +280,7 @@ private int getMaxRetryCount(RqueueMessage rqueueMessage, QueueDetail queueDetai
private void handleFailure(JobImpl job, int failureCount, Throwable throwable) {
if (job.getQueueDetail().isDoNotRetryError(throwable)) {
- handleFailedIgnoredMessage(job, failureCount);
+ handleRetryExceededMessage(job, failureCount, throwable);
} else {
int maxRetryCount = getMaxRetryCount(job.getRqueueMessage(), job.getQueueDetail());
if (failureCount < maxRetryCount) {
@@ -292,8 +289,6 @@ private void handleFailure(JobImpl job, int failureCount, Throwable throwable) {
throwable);
if (delay == TaskExecutionBackOff.STOP) {
handleRetryExceededMessage(job, failureCount, throwable);
- } else if (delay == TaskExecutionBackOff.DO_NOT_RETRY) {
- handleFailedIgnoredMessage(job, failureCount);
} else {
parkMessageForRetry(job, null, failureCount, delay);
}
@@ -312,14 +307,4 @@ private void handleIgnoredMessage(JobImpl job, int failureCount) {
job.getQueueDetail().getName());
deleteMessage(job, MessageStatus.IGNORED, failureCount);
}
-
- private void handleFailedIgnoredMessage(JobImpl job, int failureCount) {
- log(
- Level.DEBUG,
- "Message {} failed & ignored, Queue: {}",
- null,
- job.getRqueueMessage(),
- job.getQueueDetail().getName());
- deleteMessage(job, MessageStatus.DISCARDED, failureCount);
- }
}
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 787dbcb6..0613a677 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
@@ -286,15 +286,10 @@ private boolean shouldRetry(long maxProcessingTime, int retryCount, int failureC
boolean doNoRetry = queueDetail.isDoNotRetryError(error);
// it should not be retried based on the exception list
if (doNoRetry) {
- status = ExecutionStatus.FAILED_IGNORED;
return false;
}
// check if this should not be retried based on the backoff
long backOff = postProcessingHandler.backOff(rqueueMessage, userMessage, failureCount, error);
- if (backOff == TaskExecutionBackOff.DO_NOT_RETRY) {
- status = ExecutionStatus.FAILED_IGNORED;
- return false;
- }
return backOff != TaskExecutionBackOff.STOP;
}
return false;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ExecutionStatus.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ExecutionStatus.java
index 90a4e6f8..bb9f5ef6 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ExecutionStatus.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ExecutionStatus.java
@@ -22,7 +22,6 @@ public enum ExecutionStatus {
THROTTLED,
DELETED,
FAILED,
- FAILED_IGNORED,
IGNORED,
OLD_MESSAGE,
QUEUE_INACTIVE,
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/TaskExecutionBackOff.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/TaskExecutionBackOff.java
index 4371ba34..8b76de3f 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/TaskExecutionBackOff.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/TaskExecutionBackOff.java
@@ -25,11 +25,6 @@ public interface TaskExecutionBackOff {
* should not be retried further.
*/
long STOP = -1;
- /**
- * Return this value, so that it will not retry post-failure, and it won't move to DLQ as well.
- */
- long DO_NOT_RETRY = -2;
-
/**
* Return the number of milliseconds to wait for the same message to be consumed.
*
Return {@value #STOP} to indicate that no further enqueue should be made for the message. @@ -44,7 +39,6 @@ public interface TaskExecutionBackOff { /** * Return the number of milliseconds to wait for the same message to be consumed. - *
Return {@value #DO_NOT_RETRY} to indicate that no further retry should be made
*Return {@value #STOP} to indicate message should be moved to DLQ if DLQ is set
* * @param message message that's fetched