Skip to content

Commit b113607

Browse files
author
Sonu Kumar
committed
update doc and handling
1 parent 43f8d7c commit b113607

File tree

11 files changed

+16
-40
lines changed

11 files changed

+16
-40
lines changed

docs/.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.1.0

docs/Gemfile.lock

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ GEM
1313
forwardable-extended (2.6.0)
1414
gemoji (3.0.1)
1515
google-protobuf (3.21.12)
16+
google-protobuf (3.21.12-x86_64-linux)
1617
http_parser.rb (0.8.0)
1718
i18n (1.12.0)
1819
concurrent-ruby (~> 1.0)
@@ -82,7 +83,7 @@ GEM
8283
safe_yaml (1.0.5)
8384
sass-embedded (1.58.0-arm64-darwin)
8485
google-protobuf (~> 3.21)
85-
sass-embedded (1.58.0-x86_64-linux-gnu)
86+
sass-embedded (1.58.0-x86_64-linux)
8687
google-protobuf (~> 3.21)
8788
strscan (3.1.0)
8889
terminal-table (3.0.2)
@@ -92,6 +93,7 @@ GEM
9293

9394
PLATFORMS
9495
arm64-darwin-21
96+
arm64-darwin-23
9597
x86_64-linux
9698

9799
DEPENDENCIES

docs/_includes/footer_custom.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Copyright &copy; 2019-{{ "now" | date: "%Y" }} Sonu Kumar. Build on {{"now"}} Distributed by an <a href="https://github.com/sonus21/rqueue/tree/main/LICENSE">Apache 2.0 license.</a>
1+
Copyright &copy; 2019-{{ "now" | date: "%Y" }} Sonu Kumar. Distributed by an <a href="https://github.com/sonus21/rqueue/tree/main/LICENSE">Apache 2.0 license.</a> Build on {{ "now" | date:"%Y-%m-%d %H:%M" }}

docs/configuration/configuration.md

-7
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ configuration or directly in the code.
1515

1616
{: .fs-6 .fw-300 }
1717

18-
## Table of contents
19-
20-
{: .no_toc .text-delta }
21-
22-
1. TOC
23-
{:toc}
24-
2518
---
2619
Apart from the basic configuration, Rqueue can be heavily customized, such as adjusting the number
2720
of tasks executed concurrently. Additional configurations can be provided using

docs/configuration/retry-and-backoff.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ the `SimpleRqueueListenerContainerFactory`. The default back-off time is 5 secon
1818

1919
In scenarios where you don't want Rqueue to retry failures, you can handle this in two ways:
2020

21-
1. **Using `RqueueListener` Annotation**: Add exceptions to the `doNotRetry` list within
21+
- **Using `RqueueListener` Annotation**: Add exceptions to the `doNotRetry` list within
2222
the `RqueueListener` annotation. This instructs Rqueue not to retry for specific exceptions.
23+
2324
```java
2425

2526
public class MessageListener{
@@ -30,7 +31,8 @@ public class MessageListener{
3031

3132
}
3233
```
33-
2. **Returning `-2` from Execution Backoff Method**: Alternatively, you can return `-2` from the
34+
35+
- **Returning `-1` from Execution Backoff Method**: Alternatively, you can return `-1` from the
3436
execution backoff method. This signals Rqueue to stop any further retry attempts for the failed
3537
message.
3638

docs/dashboard.md

+4
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,21 @@ prefix: [http://localhost:8080/my-application/rqueue](http://localhost:8080/my-a
8484
### Dashboard Screenshots
8585

8686
#### Latency Graph
87+
<br/>
8788

8889
[![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)
8990

9091
#### Queue Statistics
92+
<br/>
9193

9294
[![Queue Statistics](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/queues.png)](https://raw.githubusercontent.com/sonus21/rqueue/master/docs/static/queues.png)
9395

9496
#### Tasks Waiting for Execution
97+
<br/>
9598

9699
[![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)
97100

98101
#### Running Tasks
102+
<br/>
99103

100104
[![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)

docs/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ frameworks.
4040
* **Queue Priority**: Supports both group-level and sub-queue level priorities.
4141
* **Long Execution Jobs**: Check-in mechanism for long-running jobs.
4242
* **Execution Backoff**: Supports exponential and fixed backoff strategies.
43-
* **Do not retry**: Supports do not retry exceptions.
43+
* **Do not retry**: Supports do not retry strategy.
4444
* **Middleware**: Allows integration of middleware to intercept messages before processing.
4545
* **Callbacks**: Supports callbacks for handling dead letter queues and discarding messages.
4646
* **Events**: Provides bootstrap and task execution events.
@@ -304,6 +304,7 @@ the [GitHub repository][Rqueue repo] or contact the maintainers directly.
304304
{: .fs-5 }
305305

306306
Rqueue is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/sonus21/rqueue/blob/master/LICENSE) file for more details.
307+
307308
[Rqueue Docs]: https://github.com/sonus21/rqueue/wiki
308309
[Boot Maven Central]: https://search.maven.org/artifact/com.github.sonus21/rqueue-spring-boot-starter
309310
[Maven Central]: https://search.maven.org/artifact/com.github.sonus21/rqueue-spring

rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/PostProcessingHandler.java

+1-16
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ void handle(JobImpl job,
8181
case IGNORED:
8282
handleIgnoredMessage(job, failureCount);
8383
break;
84-
case FAILED_IGNORED:
85-
handleFailedIgnoredMessage(job, failureCount);
86-
break;
8784
case OLD_MESSAGE:
8885
handleOldMessage(job, job.getRqueueMessage());
8986
break;
@@ -283,7 +280,7 @@ private int getMaxRetryCount(RqueueMessage rqueueMessage, QueueDetail queueDetai
283280

284281
private void handleFailure(JobImpl job, int failureCount, Throwable throwable) {
285282
if (job.getQueueDetail().isDoNotRetryError(throwable)) {
286-
handleFailedIgnoredMessage(job, failureCount);
283+
handleRetryExceededMessage(job, failureCount, throwable);
287284
} else {
288285
int maxRetryCount = getMaxRetryCount(job.getRqueueMessage(), job.getQueueDetail());
289286
if (failureCount < maxRetryCount) {
@@ -292,8 +289,6 @@ private void handleFailure(JobImpl job, int failureCount, Throwable throwable) {
292289
throwable);
293290
if (delay == TaskExecutionBackOff.STOP) {
294291
handleRetryExceededMessage(job, failureCount, throwable);
295-
} else if (delay == TaskExecutionBackOff.DO_NOT_RETRY) {
296-
handleFailedIgnoredMessage(job, failureCount);
297292
} else {
298293
parkMessageForRetry(job, null, failureCount, delay);
299294
}
@@ -312,14 +307,4 @@ private void handleIgnoredMessage(JobImpl job, int failureCount) {
312307
job.getQueueDetail().getName());
313308
deleteMessage(job, MessageStatus.IGNORED, failureCount);
314309
}
315-
316-
private void handleFailedIgnoredMessage(JobImpl job, int failureCount) {
317-
log(
318-
Level.DEBUG,
319-
"Message {} failed & ignored, Queue: {}",
320-
null,
321-
job.getRqueueMessage(),
322-
job.getQueueDetail().getName());
323-
deleteMessage(job, MessageStatus.DISCARDED, failureCount);
324-
}
325310
}

rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueExecutor.java

-5
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,10 @@ private boolean shouldRetry(long maxProcessingTime, int retryCount, int failureC
286286
boolean doNoRetry = queueDetail.isDoNotRetryError(error);
287287
// it should not be retried based on the exception list
288288
if (doNoRetry) {
289-
status = ExecutionStatus.FAILED_IGNORED;
290289
return false;
291290
}
292291
// check if this should not be retried based on the backoff
293292
long backOff = postProcessingHandler.backOff(rqueueMessage, userMessage, failureCount, error);
294-
if (backOff == TaskExecutionBackOff.DO_NOT_RETRY) {
295-
status = ExecutionStatus.FAILED_IGNORED;
296-
return false;
297-
}
298293
return backOff != TaskExecutionBackOff.STOP;
299294
}
300295
return false;

rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ExecutionStatus.java

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public enum ExecutionStatus {
2222
THROTTLED,
2323
DELETED,
2424
FAILED,
25-
FAILED_IGNORED,
2625
IGNORED,
2726
OLD_MESSAGE,
2827
QUEUE_INACTIVE,

rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/TaskExecutionBackOff.java

-6
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ public interface TaskExecutionBackOff {
2525
* should not be retried further.
2626
*/
2727
long STOP = -1;
28-
/**
29-
* Return this value, so that it will not retry post-failure, and it won't move to DLQ as well.
30-
*/
31-
long DO_NOT_RETRY = -2;
32-
3328
/**
3429
* Return the number of milliseconds to wait for the same message to be consumed.
3530
* <p>Return {@value #STOP} to indicate that no further enqueue should be made for the message.
@@ -44,7 +39,6 @@ public interface TaskExecutionBackOff {
4439

4540
/**
4641
* Return the number of milliseconds to wait for the same message to be consumed.
47-
* <p>Return {@value #DO_NOT_RETRY} to indicate that no further retry should be made</p>
4842
* <p>Return {@value #STOP} to indicate message should be moved to DLQ if DLQ is set</p>
4943
*
5044
* @param message message that's fetched

0 commit comments

Comments
 (0)