Skip to content

Commit c03adb8

Browse files
committed
update code to use java 21
1 parent c68143d commit c03adb8

18 files changed

Lines changed: 77 additions & 96 deletions

File tree

.github/workflows/pages.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Setup Ruby
4747
uses: ruby/setup-ruby@v1 # Update to latest version as needed
4848
with:
49-
ruby-version: '3.1' # Not needed with a .ruby-version file
49+
ruby-version: '3.2' # Keep this aligned with docs/.ruby-version and nokogiri's Ruby requirement
5050
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
5151
cache-version: 0 # Increment this number if you need to re-download cached gems
5252
working-directory: '${{ github.workspace }}/docs'
@@ -65,4 +65,4 @@ jobs:
6565
path: 'docs/_site/'
6666
- name: Deploy to GitHub Pages
6767
id: deployment
68-
uses: actions/deploy-pages@v3
68+
uses: actions/deploy-pages@v3

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ well, where all services code is in Spring.
5353
### Requirements
5454

5555
* Spring 5+, 6+, 7+
56-
* Java 1.8+,17
57-
* Spring boot 2+,3+,4+
56+
* Java 1.8+,17, 21
57+
* Spring boot 2+,3+
5858
* Lettuce client for Redis cluster
5959
* Read master preference for Redis cluster
6060

@@ -68,23 +68,22 @@ Release Version: [Maven central](https://search.maven.org/search?q=g:com.github.
6868

6969
**NOTE:**
7070

71-
* For spring boot 2.x use Rqueue 2.x
72-
* For spring boot 3.x use Rqueue 3.x
71+
* For Spring Boot 3.x use Rqueue 3.x
7372

7473
Get the latest one
7574
from [Maven central](https://search.maven.org/search?q=g:com.github.sonus21%20AND%20a:rqueue-spring-boot-starter)
7675

7776
* Add dependency
7877
* Gradle
7978
```groovy
80-
implementation 'com.github.sonus21:rqueue-spring-boot-starter:2.13.1-RELEASE'
79+
implementation 'com.github.sonus21:rqueue-spring-boot-starter:3.0.0-RELEASE'
8180
```
8281
* Maven
8382
```xml
8483
<dependency>
8584
<groupId>com.github.sonus21</groupId>
8685
<artifactId>rqueue-spring-boot-starter</artifactId>
87-
<version>2.13.1-RELEASE</version>
86+
<version>3.0.0-RELEASE</version>
8887
</dependency>
8988
```
9089
@@ -96,24 +95,22 @@ from [Maven central](https://search.maven.org/search?q=g:com.github.sonus21%20AN
9695
9796
**NOTE**
9897
99-
* For spring framework 5.x use rqueue-spring 2.x
100-
* For spring framework 6.x use rqueue-spring 3.x
101-
* For spring framework 7.x use rqueue-spring 4.x
98+
* For Spring Framework 6.x use Rqueue 3.x
10299
103100
Get the latest one
104101
from [Maven central](https://search.maven.org/search?q=g:com.github.sonus21%20AND%20a:rqueue-spring)
105102
106103
* Add Dependency
107104
* Gradle
108105
```groovy
109-
implementation 'com.github.sonus21:rqueue-spring:2.13.1-RELEASE'
106+
implementation 'com.github.sonus21:rqueue-spring:3.0.0-RELEASE'
110107
```
111108
* Maven
112109
```xml
113110
<dependency>
114111
<groupId>com.github.sonus21</groupId>
115112
<artifactId>rqueue-spring</artifactId>
116-
<version>2.13.1-RELEASE</version>
113+
<version>3.0.0-RELEASE</version>
117114
</dependency>
118115
```
119116
* Add annotation `EnableRqueue` on application config class

build.gradle

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ allprojects {
1313
apply plugin: "org.gradle.test-retry"
1414

1515
java {
16-
sourceCompatibility = "17"
17-
targetCompatibility = "17"
16+
toolchain {
17+
languageVersion = JavaLanguageVersion.of(21)
18+
}
19+
sourceCompatibility = JavaVersion.VERSION_21
20+
targetCompatibility = JavaVersion.VERSION_21
1821
}
1922

2023
repositories {
@@ -24,10 +27,10 @@ allprojects {
2427
}
2528

2629
ext {
27-
springBootVersion = "4.0.1"
28-
springVersion = "7.0.3"
29-
springDataVersion = "4.0.2"
30-
microMeterVersion = "1.16.2"
30+
springBootVersion = "3.5.0"
31+
springVersion = "6.2.0"
32+
springDataVersion = "3.5.0"
33+
microMeterVersion = "1.15.0"
3134

3235
// logging dependencies
3336
lombokVersion = "1.18.42"
@@ -72,7 +75,7 @@ ext {
7275

7376
subprojects {
7477
group = "com.github.sonus21"
75-
version = "4.0.0-RELEASE"
78+
version = "3.0.0-RELEASE"
7679

7780
dependencies {
7881
// https://mvnrepository.com/artifact/org.springframework/spring-messaging

docs/.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.0
1+
3.2.0

docs/CHANGELOG.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ This release fixes a critical bug where task multiplication caused excessive Red
4646
resource usage. For details, see issue #[193].
4747

4848

49-
## Release [3.0.1] 17-Jan-2022
49+
## Release [3.0.0] 17-Jan-2022
5050

51-
We're so excited to release Rqueue `3.0.1`. This release supports the Java 17, Spring Boot 3.x and
52-
Spring Framework 6.x
51+
We're so excited to release Rqueue `3.0.0`. This release supports Java 21,
52+
Spring Boot 3.x and Spring Framework 6.x.
5353

5454
### [2.13.0] - 25-Dec-2022
5555
### Fixes
@@ -382,9 +382,7 @@ Breaking change, for migration [see](./migration#1x-to-2x)
382382

383383
[2.13.1]: https://repo1.maven.org/maven2/com/github/sonus21/rqueue-core/2.13.1-RELEASE
384384

385-
[3.0.1]: https://repo1.maven.org/maven2/com/github/sonus21/rqueue-core/3.0.0-RELEASE
386-
387-
[3.1.0]: https://repo1.maven.org/maven2/com/github/sonus21/rqueue-core/3.1.0-RELEASE
385+
[3.0.0]: https://repo1.maven.org/maven2/com/github/sonus21/rqueue-core/3.0.0-RELEASE
388386

389387
[122]: https://github.com/sonus21/rqueue/issues/122
390388
[193]: https://github.com/sonus21/rqueue/issues/193

docs/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
source "https://rubygems.org"
2+
ruby ">= 3.2.0"
23
# Hello! This is where you manage which Jekyll version is used to run.
34
# When you want to use a different version, change it below, save the
45
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:

docs/index.md

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ frameworks.
5050

5151
### Requirements
5252

53-
* Spring 5+, 6+, 7+
54-
* Spring Boot 2+, 3+, 4+
53+
* Spring 6+
54+
* Spring Boot 3+
55+
* Java 21+
5556
* Spring Reactive
5657
* Lettuce client for Redis cluster
5758
* Read master preference for Redis cluster
@@ -80,41 +81,24 @@ Redis Cluster compatibility. Failure to do so may prevent the application from s
8081
### Spring Boot
8182

8283
{: .warning }
83-
Use Rqueue Spring Boot Starter 4.x for Spring Boot 4.x, 3.x for Spring Boot 3.x,
84-
and 2.x for Spring Boot 2.x.
84+
Use Rqueue Spring Boot Starter 3.x for Spring Boot 3.x.
8585

8686
Download the latest version from [Maven Central][Boot Maven Central] and add the
8787
dependency to your project:
8888

89-
#### Spring Boot 2.x Setup
90-
91-
* Gradle
92-
```groovy
93-
implementation 'com.github.sonus21:rqueue-spring-boot-starter:2.13.1-RELEASE'
94-
```
95-
96-
* Maven
97-
```xml
98-
<dependency>
99-
<groupId>com.github.sonus21</groupId>
100-
<artifactId>rqueue-spring-boot-starter</artifactId>
101-
<version>2.13.1-RELEASE</version>
102-
</dependency>
103-
```
104-
10589
#### Spring Boot 3.x Setup
10690

10791
* Gradle
10892
```groovy
109-
implementation 'com.github.sonus21:rqueue-spring-boot-starter:3.1.0-RELEASE'
93+
implementation 'com.github.sonus21:rqueue-spring-boot-starter:3.0.0-RELEASE'
11094
```
11195

11296
* Maven
11397
```xml
11498
<dependency>
11599
<groupId>com.github.sonus21</groupId>
116100
<artifactId>rqueue-spring-boot-starter</artifactId>
117-
<version>3.1.0-RELEASE</version>
101+
<version>3.0.0-RELEASE</version>
118102
</dependency>
119103
```
120104

@@ -123,41 +107,24 @@ dependency to your project:
123107
### Spring Framework
124108

125109
{: .warning }
126-
Use Rqueue Spring 4.x for Spring Framework 7.x, 3.x for Spring Framework 6.x,
127-
and 2.x for Spring Framework 5.x.
110+
Use Rqueue Spring 3.x for Spring Framework 6.x.
128111

129112
Download the latest version from [Maven Central][Maven Central] and add the
130113
dependency to your project:
131114

132-
#### Spring Framework 5.x Setup
133-
134-
* Gradle
135-
```groovy
136-
implementation 'com.github.sonus21:rqueue-spring:2.13.1-RELEASE'
137-
```
138-
139-
* Maven
140-
```xml
141-
<dependency>
142-
<groupId>com.github.sonus21</groupId>
143-
<artifactId>rqueue-spring</artifactId>
144-
<version>2.13.1-RELEASE</version>
145-
</dependency>
146-
```
147-
148115
#### Spring Framework 6.x Setup
149116

150117
* Gradle
151118
```groovy
152-
implementation 'com.github.sonus21:rqueue-spring:3.1.0-RELEASE'
119+
implementation 'com.github.sonus21:rqueue-spring:3.0.0-RELEASE'
153120
```
154121

155122
* Maven
156123
```xml
157124
<dependency>
158125
<groupId>com.github.sonus21</groupId>
159126
<artifactId>rqueue-spring</artifactId>
160-
<version>3.1.0-RELEASE</version>
127+
<version>3.0.0-RELEASE</version>
161128
</dependency>
162129
```
163130

docs/message-handling/queue-priority.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ permalink: /priority
88
---
99

1010
Queue prioritization ensures that critical tasks are handled before lower-priority
11-
ones. Rqueue supports two modes of priority handling:
11+
ones. Rqueue supports three modes of priority handling:
1212

1313
1. **Weighted**: Polling frequency is based on numeric weights assigned to queues.
14-
2. **Strict**: Higher-priority queues are always polled first.
14+
2. **Strict**: Higher-priority queues are polled first, but starvation is considered
15+
so lower-priority queues still get polling opportunities.
16+
3. **Hard Strict**: Messages are always fetched from the highest-priority queue first,
17+
moving top-down only when that queue has no available message.
1518

1619
### Configuring Priority
1720

1821
To enable priority handling:
19-
- Set `priorityMode` in the container factory to `STRICT` or `WEIGHTED`.
22+
- Set `priorityMode` in the container factory to `WEIGHTED`, `STRICT`, or `HARD_STRICT`.
2023
- Use the `priority` field in the `@RqueueListener` annotation to assign weights or levels.
2124
- Use the `priorityGroup` field to group multiple related queues. By default, queues with
2225
specified priorities are added to a default group.
@@ -49,19 +52,32 @@ For implementation details, see [WeightedPriorityPoller][WeightedPriorityPoller]
4952

5053
### Strict Priority
5154

52-
In strict mode, the poller always attempts to fetch messages from the highest-priority
53-
queue first.
55+
In strict mode, the poller prefers the highest-priority queue first, but it also
56+
considers starvation so every queue continues to get polling chances over time.
5457

5558
- The poller starts with Q1.
5659
- If Q1 is empty, it moves to Q2, then Q3.
57-
- If a queue is empty, it becomes inactive for the duration of the
60+
- If a queue is empty, it becomes inactive for the duration of the
5861
**polling interval**.
59-
- To prevent total starvation of lower-priority queues, inactive queues become
60-
eligible for polling again after a maximum of 1 minute, even if higher-priority
61-
queues still have work.
62+
- If messages are not fetched from a lower-priority queue for a certain interval,
63+
that queue becomes eligible again so it can be polled even while higher-priority
64+
queues continue to receive traffic.
65+
- This gives lower-priority queues a chance to make progress and prevents permanent
66+
starvation.
6267

6368
For implementation details, see [StrictPriorityPoller][StrictPriorityPoller].
6469

70+
### Hard Strict Priority
71+
72+
In hard strict mode, the poller always follows a top-down priority order.
73+
74+
- The poller starts with the highest-priority queue.
75+
- It continues to fetch from that queue as long as messages are available.
76+
- It moves to the next queue only when the current higher-priority queue has no
77+
message available.
78+
- This approach keeps the queue order fully top-down and may starve lower-priority
79+
queues while higher-priority queues continue to receive traffic.
80+
6581
### Additional Configuration
6682

6783
* **`rqueue.add.default.queue.with.queue.level.priority`**: Determines if a "default"

rqueue-core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dependencies {
5353
// https://mvnrepository.com/artifact/org.springframework/spring-webmvc
5454
api "org.springframework:spring-webmvc:${springVersion}"
5555
api "org.springframework:spring-webflux:${springVersion}"
56-
api "io.pebbletemplates:pebble-spring7:${pebbleVersion}"
56+
api "io.pebbletemplates:pebble-spring6:${pebbleVersion}"
5757
api "io.seruco.encoding:base62:${serucoEncodingVersion}"
5858
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
5959
api "org.apache.commons:commons-collections4:${apacheCommonCollectionVerion}"
@@ -71,4 +71,4 @@ processResources {
7171
def contents = "Version: $version\n"
7272
new File(resourcesDir, "META-INF/RQUEUE.MF").text = contents
7373
}
74-
}
74+
}

rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/JsonMessageConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import lombok.extern.slf4j.Slf4j;
2323
import org.springframework.messaging.Message;
2424
import org.springframework.messaging.MessageHeaders;
25-
import org.springframework.messaging.converter.JacksonJsonMessageConverter;
25+
import org.springframework.messaging.converter.MappingJackson2MessageConverter;
2626
import org.springframework.messaging.converter.MessageConverter;
2727
import org.springframework.messaging.support.GenericMessage;
2828
import tools.jackson.core.JacksonException;
@@ -37,7 +37,7 @@
3737
* <p>Target class is null till the time method arguments are not resolved, once method arguments
3838
* are resolved then it will become non-null.
3939
*
40-
* @see JacksonJsonMessageConverter
40+
* @see MappingJackson2MessageConverter
4141
*/
4242
@Slf4j
4343
public class JsonMessageConverter implements MessageConverter {

0 commit comments

Comments
 (0)