stringRqueueRedisTemplate) {
return new RqueueInternalPubSubChannel(
rqueueRedisListenerContainerFactory,
rqueueMessageListenerContainer,
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/RqueueSchedulerConfig.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/RqueueSchedulerConfig.java
index 32883179..becdb743 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/RqueueSchedulerConfig.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/RqueueSchedulerConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/RqueueWebConfig.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/RqueueWebConfig.java
index 9e8a05ff..934f35a4 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/RqueueWebConfig.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/RqueueWebConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/SimpleRqueueListenerContainerFactory.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/SimpleRqueueListenerContainerFactory.java
index b5d85f8c..9d214e5d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/SimpleRqueueListenerContainerFactory.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/config/SimpleRqueueListenerContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2025 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -306,13 +306,11 @@ public RqueueMessageListenerContainer createMessageListenerContainer() {
notNull(redisConnectionFactory, "redisConnectionFactory must not be null");
notNull(messageConverterProvider, "messageConverterProvider must not be null");
if (rqueueMessageTemplate == null) {
- rqueueMessageTemplate =
- new RqueueMessageTemplateImpl(
- getRedisConnectionFactory(), getReactiveRedisConnectionFactory());
+ rqueueMessageTemplate = new RqueueMessageTemplateImpl(
+ getRedisConnectionFactory(), getReactiveRedisConnectionFactory());
}
- RqueueMessageListenerContainer messageListenerContainer =
- new RqueueMessageListenerContainer(
- getRqueueMessageHandler(messageConverterProvider), rqueueMessageTemplate);
+ RqueueMessageListenerContainer messageListenerContainer = new RqueueMessageListenerContainer(
+ getRqueueMessageHandler(messageConverterProvider), rqueueMessageTemplate);
messageListenerContainer.setAutoStartup(autoStartup);
if (taskExecutor != null) {
messageListenerContainer.setTaskExecutor(taskExecutor);
@@ -352,7 +350,8 @@ public RqueueMessageListenerContainer createMessageListenerContainer() {
messageListenerContainer.setMessageHeaders(messageHeaders);
}
if (hardStrictPriorityPollerProperties != null) {
- messageListenerContainer.setHardStrictPriorityPollerProperties(hardStrictPriorityPollerProperties);
+ messageListenerContainer.setHardStrictPriorityPollerProperties(
+ hardStrictPriorityPollerProperties);
}
return messageListenerContainer;
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/DefaultMessageConverterProvider.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/DefaultMessageConverterProvider.java
index 665b4d56..3c4c57d7 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/DefaultMessageConverterProvider.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/DefaultMessageConverterProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/GenericMessageConverter.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/GenericMessageConverter.java
index c2fccea2..8a21ef5b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/GenericMessageConverter.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/GenericMessageConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/JsonMessageConverter.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/JsonMessageConverter.java
index 3ee447d3..79fad251 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/JsonMessageConverter.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/JsonMessageConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
-import org.springframework.messaging.converter.JacksonJsonMessageConverter;
import org.springframework.messaging.converter.MessageConverter;
import org.springframework.messaging.support.GenericMessage;
import tools.jackson.core.JacksonException;
@@ -37,7 +36,7 @@
* Target class is null till the time method arguments are not resolved, once method arguments
* are resolved then it will become non-null.
*
- * @see JacksonJsonMessageConverter
+ * @see org.springframework.messaging.converter.JacksonJsonMessageConverter
*/
@Slf4j
public class JsonMessageConverter implements MessageConverter {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/MessageConverterProvider.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/MessageConverterProvider.java
index abb3b3ae..8467618e 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/MessageConverterProvider.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/MessageConverterProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
import com.github.sonus21.rqueue.core.DefaultRqueueMessageConverter;
import org.springframework.messaging.Message;
import org.springframework.messaging.converter.CompositeMessageConverter;
+import org.springframework.messaging.converter.JacksonJsonMessageConverter;
import org.springframework.messaging.converter.MappingJackson2MessageConverter;
import org.springframework.messaging.converter.MessageConverter;
import org.springframework.messaging.converter.SmartMessageConverter;
@@ -40,6 +41,7 @@
* @see CompositeMessageConverter
* @see SmartMessageConverter
* @see DefaultRqueueMessageConverter
+ * @see JacksonJsonMessageConverter
* @see MappingJackson2MessageConverter
*/
public interface MessageConverterProvider {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/RqueueRedisSerializer.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/RqueueRedisSerializer.java
index b37388bc..c82b94ce 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/RqueueRedisSerializer.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/converter/RqueueRedisSerializer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -68,11 +68,15 @@ private static class RqueueRedisSerDes implements RedisSerializer {
private ObjectMapper mapper;
RqueueRedisSerDes() {
- this.mapper = SerializationUtils.createObjectMapper().rebuild()
+ this.mapper = SerializationUtils.createObjectMapper()
+ .rebuild()
.addModule(new SimpleModule().addSerializer(new NullValueSerializer()))
- .activateDefaultTyping(BasicPolymorphicTypeValidator.builder()
- .allowIfSubType(Object.class)
- .build(), DefaultTyping.NON_FINAL, As.PROPERTY)
+ .activateDefaultTyping(
+ BasicPolymorphicTypeValidator.builder()
+ .allowIfSubType(Object.class)
+ .build(),
+ DefaultTyping.NON_FINAL,
+ As.PROPERTY)
.build();
}
@@ -111,7 +115,9 @@ private static class NullValueSerializer extends StdSerializer {
}
@Override
- public void serialize(NullValue value, JsonGenerator jsonGenerator, SerializationContext provider) throws JacksonException {
+ public void serialize(
+ NullValue value, JsonGenerator jsonGenerator, SerializationContext provider)
+ throws JacksonException {
jsonGenerator.writeStartObject();
jsonGenerator.writeStringProperty(classIdentifier, NullValue.class.getName());
jsonGenerator.writeEndObject();
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/DefaultRqueueMessageConverter.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/DefaultRqueueMessageConverter.java
index 0825f786..506b72d0 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/DefaultRqueueMessageConverter.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/DefaultRqueueMessageConverter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/EndpointRegistry.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/EndpointRegistry.java
index 3dd16976..8c496659 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/EndpointRegistry.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/EndpointRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -39,8 +39,7 @@ public final class EndpointRegistry {
private static final Object lock = new Object();
private static final Map queueNameToDetail = new HashMap<>();
- private EndpointRegistry() {
- }
+ private EndpointRegistry() {}
/**
* Get QueueDetail for the given queue. If queue is having priority than it should be called with
@@ -95,11 +94,10 @@ public static void delete() {
public static List getActiveQueues() {
synchronized (lock) {
- List queues =
- queueNameToDetail.values().stream()
- .filter(QueueDetail::isActive)
- .map(QueueDetail::getName)
- .collect(Collectors.toList());
+ List queues = queueNameToDetail.values().stream()
+ .filter(QueueDetail::isActive)
+ .map(QueueDetail::getName)
+ .collect(Collectors.toList());
lock.notifyAll();
return queues;
}
@@ -107,10 +105,9 @@ public static List getActiveQueues() {
public static List getActiveQueueDetails() {
synchronized (lock) {
- List queueDetails =
- queueNameToDetail.values().stream()
- .filter(QueueDetail::isActive)
- .collect(Collectors.toList());
+ List queueDetails = queueNameToDetail.values().stream()
+ .filter(QueueDetail::isActive)
+ .collect(Collectors.toList());
lock.notifyAll();
return queueDetails;
}
@@ -118,10 +115,9 @@ public static List getActiveQueueDetails() {
public static Map getActiveQueueMap() {
synchronized (lock) {
- Map queueDetails =
- queueNameToDetail.values().stream()
- .filter(QueueDetail::isActive)
- .collect(Collectors.toMap(QueueDetail::getName, Function.identity()));
+ Map queueDetails = queueNameToDetail.values().stream()
+ .filter(QueueDetail::isActive)
+ .collect(Collectors.toMap(QueueDetail::getName, Function.identity()));
lock.notifyAll();
return queueDetails;
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/Job.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/Job.java
index 840d10c0..6f22d358 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/Job.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/Job.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/MessageScheduler.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/MessageScheduler.java
index 2998b6ad..83d20cc9 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/MessageScheduler.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/MessageScheduler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
import com.github.sonus21.rqueue.models.event.RqueueBootstrapEvent;
import com.github.sonus21.rqueue.utils.Constants;
import com.github.sonus21.rqueue.utils.ThreadUtils;
+import com.google.common.annotations.VisibleForTesting;
import java.time.Duration;
import java.util.Arrays;
import java.util.List;
@@ -33,7 +34,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledFuture;
-import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
@@ -48,14 +48,17 @@
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
-public abstract class MessageScheduler implements DisposableBean,
- ApplicationListener {
+public abstract class MessageScheduler
+ implements DisposableBean, ApplicationListener {
private final Object monitor = new Object();
+
@Autowired
protected RqueueSchedulerConfig rqueueSchedulerConfig;
+
@Autowired
protected RqueueConfig rqueueConfig;
+
private RedisScript redisScript;
private DefaultScriptExecutor defaultScriptExecutor;
private Map queueRunningState;
@@ -66,12 +69,14 @@ public abstract class MessageScheduler implements DisposableBean,
protected RedisScheduleTriggerHandler redisScheduleTriggerHandler;
private ThreadPoolTaskScheduler scheduler;
+
@Autowired
private RqueueRedisListenerContainerFactory rqueueRedisListenerContainerFactory;
@Autowired
@Qualifier("rqueueRedisLongTemplate")
private RedisTemplate redisTemplate;
+
private Map errorCount;
protected abstract Logger getLogger();
@@ -152,13 +157,13 @@ private void waitForRunningQueuesToStop() {
scheduledFuture,
rqueueSchedulerConfig.getTerminationWaitTime(),
"An exception occurred while stopping scheduler queue '{}'",
- queueName
- );
+ queueName);
}
}
private void stopQueue(String queueName) {
- Assert.isTrue(queueRunningState.containsKey(queueName),
+ Assert.isTrue(
+ queueRunningState.containsKey(queueName),
"Queue with name '" + queueName + "' does not exist");
queueRunningState.put(queueName, false);
}
@@ -305,7 +310,7 @@ private List scriptKeys() {
private Object[] scriptArgs() {
long currentTime = System.currentTimeMillis();
- return new Object[]{currentTime, getMessageCount(), processingQueue ? 1 : 0};
+ return new Object[] {currentTime, getMessageCount(), processingQueue ? 1 : 0};
}
private boolean shouldSkip(long currentTime) {
@@ -342,5 +347,4 @@ public String getName() {
return this.name;
}
}
-
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ProcessingQueueMessageScheduler.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ProcessingQueueMessageScheduler.java
index 276a0903..e89035a8 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ProcessingQueueMessageScheduler.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ProcessingQueueMessageScheduler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -19,11 +19,9 @@
import static java.lang.Long.max;
import com.github.sonus21.rqueue.listener.QueueDetail;
-import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import com.github.sonus21.rqueue.utils.Constants;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ReactiveRqueueMessageEnqueuer.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ReactiveRqueueMessageEnqueuer.java
index cdbe0ecc..e989003b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ReactiveRqueueMessageEnqueuer.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ReactiveRqueueMessageEnqueuer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RedisScheduleTriggerHandler.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RedisScheduleTriggerHandler.java
index 4fb41d1b..ea94695d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RedisScheduleTriggerHandler.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RedisScheduleTriggerHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -18,17 +18,16 @@
import com.github.sonus21.rqueue.config.RqueueSchedulerConfig;
import com.github.sonus21.rqueue.utils.ThreadUtils;
import com.google.common.annotations.VisibleForTesting;
-import org.slf4j.Logger;
-import org.springframework.data.redis.connection.Message;
-import org.springframework.data.redis.connection.MessageListener;
-import org.springframework.data.redis.listener.ChannelTopic;
-
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Future;
import java.util.function.Function;
+import org.slf4j.Logger;
+import org.springframework.data.redis.connection.Message;
+import org.springframework.data.redis.connection.MessageListener;
+import org.springframework.data.redis.listener.ChannelTopic;
class RedisScheduleTriggerHandler {
@@ -41,17 +40,23 @@ class RedisScheduleTriggerHandler {
@VisibleForTesting
Map queueNameToLastRunTime;
+
@VisibleForTesting
Map> queueNameToFuture;
+
@VisibleForTesting
Map channelNameToQueueName;
+
@VisibleForTesting
MessageListener messageListener;
- RedisScheduleTriggerHandler(Logger logger,
+ RedisScheduleTriggerHandler(
+ Logger logger,
RqueueRedisListenerContainerFactory rqueueRedisListenerContainerFactory,
- RqueueSchedulerConfig rqueueSchedulerConfig, List queueNames,
- Function> scheduler, Function channelNameProducer) {
+ RqueueSchedulerConfig rqueueSchedulerConfig,
+ List queueNames,
+ Function> scheduler,
+ Function channelNameProducer) {
this.queueNames = queueNames;
this.rqueueSchedulerConfig = rqueueSchedulerConfig;
this.rqueueRedisListenerContainerFactory = rqueueRedisListenerContainerFactory;
@@ -80,8 +85,12 @@ void startQueue(String queueName) {
void stopQueue(String queueName) {
Future> future = queueNameToFuture.get(queueName);
- ThreadUtils.waitForTermination(logger, future, rqueueSchedulerConfig.getTerminationWaitTime(),
- "An exception occurred while stopping scheduler queue '{}'", queueName);
+ ThreadUtils.waitForTermination(
+ logger,
+ future,
+ rqueueSchedulerConfig.getTerminationWaitTime(),
+ "An exception occurred while stopping scheduler queue '{}'",
+ queueName);
queueNameToLastRunTime.put(queueName, 0L);
queueNameToFuture.remove(queueName);
unsubscribeFromRedis(queueName);
@@ -90,8 +99,8 @@ void stopQueue(String queueName) {
private void unsubscribeFromRedis(String queueName) {
String channelName = channelNameProducer.apply(queueName);
logger.debug("Queue {} unsubscribe from channel {}", queueName, channelName);
- rqueueRedisListenerContainerFactory.removeMessageListener(messageListener,
- new ChannelTopic(channelName));
+ rqueueRedisListenerContainerFactory.removeMessageListener(
+ messageListener, new ChannelTopic(channelName));
channelNameToQueueName.put(channelName, queueName);
}
@@ -99,15 +108,14 @@ private void subscribeToRedisTopic(String queueName) {
String channelName = channelNameProducer.apply(queueName);
channelNameToQueueName.put(channelName, queueName);
logger.debug("Queue {} subscribe to channel {}", queueName, channelName);
- rqueueRedisListenerContainerFactory.addMessageListener(messageListener,
- new ChannelTopic(channelName));
+ rqueueRedisListenerContainerFactory.addMessageListener(
+ messageListener, new ChannelTopic(channelName));
}
protected long getMinDelay() {
return rqueueSchedulerConfig.minMessageMoveDelay();
}
-
/**
* This MessageListener listen the event from Redis, its expected that the event should be only
* raised when elements in the ZSET are lagging behind current time.
@@ -126,8 +134,8 @@ private void schedule(String queueName, long currentTime) {
private void handleMessage(String queueName, long startTime) {
long currentTime = System.currentTimeMillis();
if (startTime > currentTime) {
- logger.warn("Received message body is not correct queue: {}, time: {}", queueName,
- startTime);
+ logger.warn(
+ "Received message body is not correct queue: {}, time: {}", queueName, startTime);
return;
}
long lastRunTime = queueNameToLastRunTime.get(queueName);
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RedisScriptFactory.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RedisScriptFactory.java
index b3f7b900..17cf4a09 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RedisScriptFactory.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RedisScriptFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueBeanProvider.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueBeanProvider.java
index 914cc89b..f0512f57 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueBeanProvider.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueBeanProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -36,14 +36,19 @@ public class RqueueBeanProvider {
@Autowired
private RqueueMessageMetadataService rqueueMessageMetadataService;
+
@Autowired
private RqueueSystemConfigDao rqueueSystemConfigDao;
+
@Autowired
private RqueueJobDao rqueueJobDao;
+
@Autowired
private RqueueWebConfig rqueueWebConfig;
+
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
+
@Autowired
private RqueueLockManager rqueueLockManager;
@@ -54,8 +59,10 @@ public class RqueueBeanProvider {
private RqueueMessageHandler rqueueMessageHandler;
private MessageProcessor preExecutionMessageProcessor;
+
@Autowired
private RqueueMessageTemplate rqueueMessageTemplate;
+
@Autowired
private RqueueConfig rqueueConfig;
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueEndpointManager.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueEndpointManager.java
index 78902122..c08627a6 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueEndpointManager.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueEndpointManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueInternalPubSubChannel.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueInternalPubSubChannel.java
index c7c73b8c..55539d78 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueInternalPubSubChannel.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueInternalPubSubChannel.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -132,10 +132,9 @@ private void handlePauseEvent(PauseUnpauseQueueRequest request) {
String lockKey = Constants.getQueueCrudLockKey(rqueueConfig, request.getName());
String lockValue = UUID.randomUUID().toString();
try {
- boolean acquired =
- rqueueBeanProvider
- .getRqueueLockManager()
- .acquireLock(lockKey, lockValue, Duration.ofMillis(100));
+ boolean acquired = rqueueBeanProvider
+ .getRqueueLockManager()
+ .acquireLock(lockKey, lockValue, Duration.ofMillis(100));
if (acquired) {
rqueueMessageListenerContainer.pauseUnpauseQueue(request.getName(), request.isPause());
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessage.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessage.java
index 1017198a..10c958b9 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessage.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageEnqueuer.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageEnqueuer.java
index a116048a..903ccc60 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageEnqueuer.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageEnqueuer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageManager.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageManager.java
index 009642ac..2cdb1ae8 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageManager.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -209,5 +209,4 @@ boolean moveMessageFromDeadLetterToQueue(
* @return success or failure
*/
boolean moveMessageFromDeadLetterToQueue(String deadLetterQueueName, String queueName);
-
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageTemplate.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageTemplate.java
index caf2e25f..ff3fc097 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageTemplate.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueMessageTemplate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueRedisListenerContainerFactory.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueRedisListenerContainerFactory.java
index 1b6cf3ed..f615164f 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueRedisListenerContainerFactory.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/RqueueRedisListenerContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ public class RqueueRedisListenerContainerFactory
@Autowired
private RqueueSchedulerConfig rqueueSchedulerConfig;
+
@Autowired
private RqueueConfig rqueueConfig;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ScheduledQueueMessageScheduler.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ScheduledQueueMessageScheduler.java
index ac660b09..beedce52 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ScheduledQueueMessageScheduler.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/ScheduledQueueMessageScheduler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/context/Context.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/context/Context.java
index a9210ce4..b1fec501 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/context/Context.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/context/Context.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/context/DefaultContext.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/context/DefaultContext.java
index 4e99179e..513c1f21 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/context/DefaultContext.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/context/DefaultContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/BaseMessageSender.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/BaseMessageSender.java
index 3002a204..55ff06c8 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/BaseMessageSender.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/BaseMessageSender.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2025 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -51,9 +51,15 @@ abstract class BaseMessageSender {
protected final MessageHeaders messageHeaders;
protected final MessageConverter messageConverter;
protected final RqueueMessageTemplate messageTemplate;
- @Autowired protected RqueueStringDao rqueueStringDao;
- @Autowired protected RqueueConfig rqueueConfig;
- @Autowired protected RqueueMessageMetadataService rqueueMessageMetadataService;
+
+ @Autowired
+ protected RqueueStringDao rqueueStringDao;
+
+ @Autowired
+ protected RqueueConfig rqueueConfig;
+
+ @Autowired
+ protected RqueueMessageMetadataService rqueueMessageMetadataService;
BaseMessageSender(
RqueueMessageTemplate messageTemplate,
@@ -113,15 +119,14 @@ protected String pushMessage(
Long delayInMilliSecs,
boolean isUnique) {
QueueDetail queueDetail = EndpointRegistry.get(queueName);
- RqueueMessage rqueueMessage =
- buildMessage(
- messageConverter,
- queueName,
- messageId,
- message,
- retryCount,
- delayInMilliSecs,
- messageHeaders);
+ RqueueMessage rqueueMessage = buildMessage(
+ messageConverter,
+ queueName,
+ messageId,
+ message,
+ retryCount,
+ delayInMilliSecs,
+ messageHeaders);
try {
storeMessageMetadata(rqueueMessage, delayInMilliSecs, false, isUnique);
enqueue(queueDetail, rqueueMessage, delayInMilliSecs, false);
@@ -139,20 +144,16 @@ protected String pushMessage(
}
protected String pushPeriodicMessage(
- String queueName,
- String messageId,
- Object message,
- long periodInMilliSeconds) {
+ String queueName, String messageId, Object message, long periodInMilliSeconds) {
QueueDetail queueDetail = EndpointRegistry.get(queueName);
- RqueueMessage rqueueMessage =
- buildPeriodicMessage(
- messageConverter,
- queueName,
- messageId,
- message,
- null,
- periodInMilliSeconds,
- messageHeaders);
+ RqueueMessage rqueueMessage = buildPeriodicMessage(
+ messageConverter,
+ queueName,
+ messageId,
+ message,
+ null,
+ periodInMilliSeconds,
+ messageHeaders);
try {
storeMessageMetadata(rqueueMessage, periodInMilliSeconds, false, false);
enqueue(queueDetail, rqueueMessage, periodInMilliSeconds, false);
@@ -165,7 +166,8 @@ protected String pushPeriodicMessage(
protected Object deleteAllMessages(QueueDetail queueDetail) {
return MessageSweeper.getInstance(rqueueConfig, messageTemplate, rqueueMessageMetadataService)
- .deleteAllMessages(MessageDeleteRequest.builder().queueDetail(queueDetail).build());
+ .deleteAllMessages(
+ MessageDeleteRequest.builder().queueDetail(queueDetail).build());
}
protected void registerQueueInternal(String queueName, String... priorities) {
@@ -177,33 +179,30 @@ protected void registerQueueInternal(String queueName, String... priorities) {
priorityMap.put(priority, 1);
}
- QueueDetail queueDetail =
- QueueDetail.builder()
- .name(queueName)
- .active(false)
- .queueName(rqueueConfig.getQueueName(queueName))
- .scheduledQueueName(rqueueConfig.getScheduledQueueName(queueName))
- .scheduledQueueChannelName(rqueueConfig.getScheduledQueueChannelName(queueName))
- .processingQueueName(rqueueConfig.getProcessingQueueName(queueName))
- .processingQueueChannelName(rqueueConfig.getProcessingQueueChannelName(queueName))
- .priority(priorityMap)
- .build();
+ QueueDetail queueDetail = QueueDetail.builder()
+ .name(queueName)
+ .active(false)
+ .queueName(rqueueConfig.getQueueName(queueName))
+ .scheduledQueueName(rqueueConfig.getScheduledQueueName(queueName))
+ .scheduledQueueChannelName(rqueueConfig.getScheduledQueueChannelName(queueName))
+ .processingQueueName(rqueueConfig.getProcessingQueueName(queueName))
+ .processingQueueChannelName(rqueueConfig.getProcessingQueueChannelName(queueName))
+ .priority(priorityMap)
+ .build();
EndpointRegistry.register(queueDetail);
for (String priority : priorities) {
String suffix = PriorityUtils.getSuffix(priority);
- queueDetail =
- QueueDetail.builder()
- .name(queueName + suffix)
- .active(false)
- .queueName(rqueueConfig.getQueueName(queueName) + suffix)
- .scheduledQueueName(rqueueConfig.getScheduledQueueName(queueName) + suffix)
- .scheduledQueueChannelName(
- rqueueConfig.getScheduledQueueChannelName(queueName) + suffix)
- .processingQueueName(rqueueConfig.getProcessingQueueName(queueName) + suffix)
- .processingQueueChannelName(
- rqueueConfig.getProcessingQueueChannelName(queueName) + suffix)
- .priority(Collections.singletonMap(DEFAULT_PRIORITY_KEY, 1))
- .build();
+ queueDetail = QueueDetail.builder()
+ .name(queueName + suffix)
+ .active(false)
+ .queueName(rqueueConfig.getQueueName(queueName) + suffix)
+ .scheduledQueueName(rqueueConfig.getScheduledQueueName(queueName) + suffix)
+ .scheduledQueueChannelName(rqueueConfig.getScheduledQueueChannelName(queueName) + suffix)
+ .processingQueueName(rqueueConfig.getProcessingQueueName(queueName) + suffix)
+ .processingQueueChannelName(
+ rqueueConfig.getProcessingQueueChannelName(queueName) + suffix)
+ .priority(Collections.singletonMap(DEFAULT_PRIORITY_KEY, 1))
+ .build();
EndpointRegistry.register(queueDetail);
}
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/MessageSweeper.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/MessageSweeper.java
index 9f3d7509..b8279c84 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/MessageSweeper.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/MessageSweeper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -199,10 +199,9 @@ private List getMessageIds(DeleteJobData data) {
public void delete(DeleteJobData data) {
for (List subIds : ListUtils.partition(getMessageIds(data), batchSize)) {
- List messageMetaIds =
- subIds.stream()
- .map(e -> RqueueMessageUtils.getMessageMetaId(queueName, e))
- .collect(Collectors.toList());
+ List messageMetaIds = subIds.stream()
+ .map(e -> RqueueMessageUtils.getMessageMetaId(queueName, e))
+ .collect(Collectors.toList());
rqueueMessageMetadataService.deleteAll(messageMetaIds);
log.debug("Deleted {} messages meta", messageMetaIds.size());
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/ReactiveRqueueMessageEnqueuerImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/ReactiveRqueueMessageEnqueuerImpl.java
index bf752c0b..78769118 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/ReactiveRqueueMessageEnqueuerImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/ReactiveRqueueMessageEnqueuerImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2025 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -26,15 +26,13 @@
import com.github.sonus21.rqueue.exception.DuplicateMessageException;
import com.github.sonus21.rqueue.listener.QueueDetail;
import com.github.sonus21.rqueue.utils.PriorityUtils;
+import java.util.function.Function;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.converter.MessageConverter;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-
@Slf4j
public class ReactiveRqueueMessageEnqueuerImpl extends BaseMessageSender
implements ReactiveRqueueMessageEnqueuer {
@@ -57,37 +55,34 @@ private Mono pushReactiveMessage(
boolean isUnique,
Function> monoConverter) {
QueueDetail queueDetail = EndpointRegistry.get(queueName);
- RqueueMessage rqueueMessage =
- builder.build(
- messageConverter,
- queueName,
- messageId,
- message,
- retryCount,
- delayInMilliSecs,
- messageHeaders);
+ RqueueMessage rqueueMessage = builder.build(
+ messageConverter,
+ queueName,
+ messageId,
+ message,
+ retryCount,
+ delayInMilliSecs,
+ messageHeaders);
try {
Mono storeResult =
(Mono) storeMessageMetadata(rqueueMessage, delayInMilliSecs, true, isUnique);
- return storeResult.flatMap(
- success -> {
- if (Boolean.TRUE.equals(success)) {
- Object result = enqueue(queueDetail, rqueueMessage, delayInMilliSecs, true);
- Mono enqueueMono;
- if (result instanceof Flux) {
- enqueueMono = ((Flux) result).next();
- } else if (result instanceof Mono) {
- enqueueMono = (Mono) result;
- } else {
- return Mono.error(
- new IllegalStateException(
- "Unexpected enqueue result type: " + result.getClass()));
- }
- return enqueueMono.flatMap(ignore -> monoConverter.apply(rqueueMessage));
- } else {
- return Mono.error(new DuplicateMessageException(rqueueMessage.getId()));
- }
- });
+ return storeResult.flatMap(success -> {
+ if (Boolean.TRUE.equals(success)) {
+ Object result = enqueue(queueDetail, rqueueMessage, delayInMilliSecs, true);
+ Mono enqueueMono;
+ if (result instanceof Flux) {
+ enqueueMono = ((Flux) result).next();
+ } else if (result instanceof Mono) {
+ enqueueMono = (Mono) result;
+ } else {
+ return Mono.error(
+ new IllegalStateException("Unexpected enqueue result type: " + result.getClass()));
+ }
+ return enqueueMono.flatMap(ignore -> monoConverter.apply(rqueueMessage));
+ } else {
+ return Mono.error(new DuplicateMessageException(rqueueMessage.getId()));
+ }
+ });
} catch (Exception e) {
log.error(
"Failed to enqueue message [{}] to queue [{}]", rqueueMessage.getId(), queueName, e);
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueEndpointManagerImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueEndpointManagerImpl.java
index 4f4e7f48..44197ad3 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueEndpointManagerImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueEndpointManagerImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -43,6 +43,7 @@ public class RqueueEndpointManagerImpl extends BaseMessageSender implements Rque
@Autowired
private RqueueUtilityService rqueueUtilityService;
+
@Autowired
private RqueueSystemConfigDao rqueueSystemConfigDao;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageEnqueuerImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageEnqueuerImpl.java
index e4f4fc04..c1fabab5 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageEnqueuerImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageEnqueuerImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2025 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -27,12 +27,11 @@
import com.github.sonus21.rqueue.core.RqueueMessageEnqueuer;
import com.github.sonus21.rqueue.core.RqueueMessageTemplate;
import com.github.sonus21.rqueue.utils.PriorityUtils;
+import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.converter.MessageConverter;
-import java.util.Objects;
-
@Slf4j
public class RqueueMessageEnqueuerImpl extends BaseMessageSender implements RqueueMessageEnqueuer {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageManagerImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageManagerImpl.java
index 9e63256b..9de4e7c6 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageManagerImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageManagerImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2025 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@
import com.github.sonus21.rqueue.core.RqueueMessageManager;
import com.github.sonus21.rqueue.core.RqueueMessageTemplate;
import com.github.sonus21.rqueue.core.support.RqueueMessageUtils;
-import com.github.sonus21.rqueue.exception.LockCanNotBeAcquired;
import com.github.sonus21.rqueue.listener.QueueDetail;
import com.github.sonus21.rqueue.listener.RqueueMessageHeaders;
import com.github.sonus21.rqueue.models.MessageMoveResult;
@@ -34,7 +33,6 @@
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
-import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
@@ -82,9 +80,8 @@ public Object getMessage(String queueName, String id) {
if (rqueueMessage == null) {
return null;
}
- Message message =
- MessageBuilder.createMessage(
- rqueueMessage.getMessage(), RqueueMessageHeaders.emptyMessageHeaders());
+ Message message = MessageBuilder.createMessage(
+ rqueueMessage.getMessage(), RqueueMessageHeaders.emptyMessageHeaders());
return messageConverter.fromMessage(message, null);
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageTemplateImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageTemplateImpl.java
index f121e775..2a2d5b03 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageTemplateImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageTemplateImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -66,10 +66,9 @@ public RqueueMessageTemplateImpl(
if (reactiveRedisConnectionFactory != null) {
this.reactiveRedisTemplate =
new ReactiveRqueueRedisTemplate<>(reactiveRedisConnectionFactory);
- this.reactiveScriptExecutor =
- new DefaultReactiveScriptExecutor<>(
- reactiveRedisConnectionFactory,
- RedisUtils.redisSerializationContextProvider.getSerializationContext());
+ this.reactiveScriptExecutor = new DefaultReactiveScriptExecutor<>(
+ reactiveRedisConnectionFactory,
+ RedisUtils.redisSerializationContextProvider.getSerializationContext());
} else {
this.reactiveScriptExecutor = null;
this.reactiveRedisTemplate = null;
@@ -89,13 +88,12 @@ public List pop(
}
long currentTime = System.currentTimeMillis();
RedisScript> script = getScript(ScriptType.DEQUEUE_MESSAGE);
- List messages =
- scriptExecutor.execute(
- script,
- Arrays.asList(queueName, processingQueueName, processingChannelName),
- currentTime,
- currentTime + visibilityTimeout,
- count);
+ List messages = scriptExecutor.execute(
+ script,
+ Arrays.asList(queueName, processingQueueName, processingChannelName),
+ currentTime,
+ currentTime + visibilityTimeout,
+ count);
log.debug("Pop Queue: {}, N: {}, Messages: {}", queueName, count, messages);
return messages;
}
@@ -153,13 +151,12 @@ public void moveMessageWithDelay(
tgtZsetName,
tgt);
RedisScript script = getScript(ScriptType.MOVE_MESSAGE_TO_ZSET);
- Long response =
- scriptExecutor.execute(
- script,
- Arrays.asList(srcZsetName, tgtZsetName),
- src,
- tgt,
- System.currentTimeMillis() + delay);
+ Long response = scriptExecutor.execute(
+ script,
+ Arrays.asList(srcZsetName, tgtZsetName),
+ src,
+ tgt,
+ System.currentTimeMillis() + delay);
if (response == null) {
log.error("Duplicate processing for the message {}", src);
}
@@ -247,9 +244,8 @@ public MessageMoveResult moveMessageListToZset(
int remainingMessages = maxMessage;
while (messagesInList > 0 && remainingMessages > 0) {
long messageCount = Math.min(remainingMessages, Constants.MAX_MESSAGES);
- messagesInList =
- scriptExecutor.execute(
- script, Arrays.asList(sourceList, destinationZset), messageCount, score);
+ messagesInList = scriptExecutor.execute(
+ script, Arrays.asList(sourceList, destinationZset), messageCount, score);
remainingMessages -= messageCount;
}
return new MessageMoveResult(maxMessage - remainingMessages, true);
@@ -267,13 +263,8 @@ public MessageMoveResult moveMessageZsetToZset(
int remainingMessages = maxMessage;
while (messageInZset > 0 && remainingMessages > 0) {
long messageCount = Math.min(remainingMessages, Constants.MAX_MESSAGES);
- messageInZset =
- scriptExecutor.execute(
- script,
- Arrays.asList(sourceZset, destinationZset),
- messageCount,
- newScore,
- fixedScore);
+ messageInZset = scriptExecutor.execute(
+ script, Arrays.asList(sourceZset, destinationZset), messageCount, newScore, fixedScore);
remainingMessages -= messageCount;
}
return new MessageMoveResult(maxMessage - remainingMessages, true);
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/ContextMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/ContextMiddleware.java
index 56547d7f..dcd993a1 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/ContextMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/ContextMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/HandlerMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/HandlerMiddleware.java
index ff8d7e06..027053fe 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/HandlerMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/HandlerMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -38,15 +38,14 @@ public HandlerMiddleware(RqueueMessageHandler rqueueMessageHandler) {
public void handle(Job job, Callable next) throws Exception {
Execution execution = job.getLatestExecution();
RqueueMessage rqueueMessage = job.getRqueueMessage();
- Message> message =
- MessageBuilder.createMessage(
- rqueueMessage.getMessage(),
- buildMessageHeaders(
- job.getQueueDetail().getName(),
- rqueueMessage,
- job,
- execution,
- rqueueMessage.getMessageHeaders()));
+ Message> message = MessageBuilder.createMessage(
+ rqueueMessage.getMessage(),
+ buildMessageHeaders(
+ job.getQueueDetail().getName(),
+ rqueueMessage,
+ job,
+ execution,
+ rqueueMessage.getMessageHeaders()));
rqueueMessageHandler.handleMessage(message);
}
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/LockMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/LockMiddleware.java
index 98fddba0..f6e738f2 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/LockMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/LockMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/LoggingMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/LoggingMiddleware.java
index 814ce219..45bfe96b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/LoggingMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/LoggingMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/Middleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/Middleware.java
index d3847c7b..c18f0a16 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/Middleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/Middleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/PermissionMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/PermissionMiddleware.java
index 97688a45..9ac759d9 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/PermissionMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/PermissionMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/ProfilerMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/ProfilerMiddleware.java
index 9a0f1df7..f1980f2d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/ProfilerMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/ProfilerMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/RateLimiterMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/RateLimiterMiddleware.java
index 2e897d1c..68474fc0 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/RateLimiterMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/RateLimiterMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/RedisLockMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/RedisLockMiddleware.java
index 2bbdd4ff..4601ea67 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/RedisLockMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/RedisLockMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/TimeProviderMiddleware.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/TimeProviderMiddleware.java
index cc2d3939..0a81f3d8 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/TimeProviderMiddleware.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/middleware/TimeProviderMiddleware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/support/MessageProcessor.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/support/MessageProcessor.java
index 076d3ff8..6240df2a 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/support/MessageProcessor.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/support/MessageProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/support/RqueueMessageUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/support/RqueueMessageUtils.java
index 20845c77..967ad14f 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/support/RqueueMessageUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/core/support/RqueueMessageUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -33,8 +33,7 @@ public final class RqueueMessageUtils {
private static final String META_DATA_KEY_PREFIX = "__rq::m-mdata::";
- private RqueueMessageUtils() {
- }
+ private RqueueMessageUtils() {}
public static String getMessageMetaId(String queueName, String messageId) {
return META_DATA_KEY_PREFIX + queueName + REDIS_KEY_SEPARATOR + messageId;
@@ -72,15 +71,14 @@ public static RqueueMessage buildPeriodicMessage(
} else {
throw new MessageConversionException("Message payload is neither String nor byte[]");
}
- RqueueMessage rqueueMessage =
- RqueueMessage.builder()
- .id(UUID.randomUUID().toString())
- .queueName(queueName)
- .message(strMessage)
- .processAt(processAt)
- .retryCount(retryCount)
- .period(period)
- .build();
+ RqueueMessage rqueueMessage = RqueueMessage.builder()
+ .id(UUID.randomUUID().toString())
+ .queueName(queueName)
+ .message(strMessage)
+ .processAt(processAt)
+ .retryCount(retryCount)
+ .period(period)
+ .build();
if (messageId != null) {
rqueueMessage.setId(messageId);
}
@@ -113,15 +111,14 @@ public static RqueueMessage buildMessage(
} else {
throw new MessageConversionException("Message payload is neither String nor byte[]");
}
- RqueueMessage rqueueMessage =
- RqueueMessage.builder()
- .retryCount(retryCount)
- .queuedTime(queuedTime)
- .id(UUID.randomUUID().toString())
- .queueName(queueName)
- .message(strMessage)
- .processAt(processAt)
- .build();
+ RqueueMessage rqueueMessage = RqueueMessage.builder()
+ .retryCount(retryCount)
+ .queuedTime(queuedTime)
+ .id(UUID.randomUUID().toString())
+ .queueName(queueName)
+ .message(strMessage)
+ .processAt(processAt)
+ .build();
if (messageId != null) {
rqueueMessage.setId(messageId);
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueJobDao.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueJobDao.java
index 88c237d8..7a9b3123 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueJobDao.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueJobDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueMessageMetadataDao.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueMessageMetadataDao.java
index 05be7034..e1821564 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueMessageMetadataDao.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueMessageMetadataDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2025 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueQStatsDao.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueQStatsDao.java
index 14f263ff..01c2fc8b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueQStatsDao.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueQStatsDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueStringDao.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueStringDao.java
index fa07895d..09c330e8 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueStringDao.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueStringDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueSystemConfigDao.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueSystemConfigDao.java
index b94ad66c..b741a707 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueSystemConfigDao.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/RqueueSystemConfigDao.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueJobDaoImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueJobDaoImpl.java
index 86cea047..91500b86 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueJobDaoImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueJobDaoImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueMessageMetadataDaoImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueMessageMetadataDaoImpl.java
index ba6c2fa0..1fa8e961 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueMessageMetadataDaoImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueMessageMetadataDaoImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2025 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -58,14 +58,14 @@ public List findAll(Collection ids) {
}
@Override
- public void save(MessageMetadata messageMetadata, Duration duration,boolean checkUniqueNess) {
+ public void save(MessageMetadata messageMetadata, Duration duration, boolean checkUniqueNess) {
Assert.notNull(messageMetadata.getId(), "messageMetadata id cannot be null");
- if(checkUniqueNess){
- Boolean value = template.setIfAbsent(messageMetadata.getId(), messageMetadata, duration);
- if(Boolean.FALSE.equals(value)){
- throw new DuplicateMessageException(messageMetadata.getId());
- }
- return;
+ if (checkUniqueNess) {
+ Boolean value = template.setIfAbsent(messageMetadata.getId(), messageMetadata, duration);
+ if (Boolean.FALSE.equals(value)) {
+ throw new DuplicateMessageException(messageMetadata.getId());
+ }
+ return;
}
template.set(messageMetadata.getId(), messageMetadata, duration);
}
@@ -81,10 +81,14 @@ public void deleteAll(Collection ids) {
}
@Override
- public Mono saveReactive(MessageMetadata messageMetadata, Duration ttl, boolean isUnique) {
+ public Mono saveReactive(
+ MessageMetadata messageMetadata, Duration ttl, boolean isUnique) {
Assert.notNull(messageMetadata.getId(), "messageMetadata id cannot be null");
- if(isUnique){
- return reactiveRedisTemplate.template().opsForValue().setIfAbsent(messageMetadata.getId(), messageMetadata, ttl);
+ if (isUnique) {
+ return reactiveRedisTemplate
+ .template()
+ .opsForValue()
+ .setIfAbsent(messageMetadata.getId(), messageMetadata, ttl);
}
return reactiveRedisTemplate
.template()
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueQStatsDaoImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueQStatsDaoImpl.java
index 0d61ca32..9f44e517 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueQStatsDaoImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueQStatsDaoImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueStringDaoImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueStringDaoImpl.java
index 3494a761..e3735437 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueStringDaoImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueStringDaoImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -54,14 +54,12 @@ public RqueueStringDaoImpl(RqueueConfig rqueueConfig) {
@SuppressWarnings("unchecked")
public Map> readFromLists(List keys) {
Map> out = new HashMap<>();
- List redisOut =
- RedisUtils.executePipeLine(
- redisTemplate.getRedisTemplate(),
- ((connection, keySerializer, valueSerializer) -> {
- for (String key : keys) {
- connection.lRange(Objects.requireNonNull(keySerializer.serialize(key)), 0, -1);
- }
- }));
+ List redisOut = RedisUtils.executePipeLine(
+ redisTemplate.getRedisTemplate(), ((connection, keySerializer, valueSerializer) -> {
+ for (String key : keys) {
+ connection.lRange(Objects.requireNonNull(keySerializer.serialize(key)), 0, -1);
+ }
+ }));
for (int i = 0; i < keys.size(); i++) {
List values = (List) redisOut.get(i);
if (!CollectionUtils.isEmpty(values)) {
@@ -79,8 +77,7 @@ public List readFromList(String key) {
@Override
public void appendToListWithListExpiry(String listName, String data, Duration duration) {
RedisUtils.executePipeLine(
- redisTemplate.getRedisTemplate(),
- (connection, keySerializer, valueSerializer) -> {
+ redisTemplate.getRedisTemplate(), (connection, keySerializer, valueSerializer) -> {
byte[] key = keySerializer.serialize(listName);
byte[] value = valueSerializer.serialize(data);
connection.rPush(key, value);
@@ -127,8 +124,7 @@ public Object delete(Collection keys) {
public Object deleteAndSet(
Collection keysToBeRemoved, Map objectsToBeStored) {
return RedisUtils.executePipeLine(
- redisTemplate.getRedisTemplate(),
- ((connection, keySerializer, valueSerializer) -> {
+ redisTemplate.getRedisTemplate(), ((connection, keySerializer, valueSerializer) -> {
// potential cross slot error
for (String key : keysToBeRemoved) {
connection.del(keySerializer.serialize(key));
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueSystemConfigDaoImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueSystemConfigDaoImpl.java
index 6aebe424..34a55d29 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueSystemConfigDaoImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/dao/impl/RqueueSystemConfigDaoImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/DuplicateMessageException.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/DuplicateMessageException.java
index df78a755..e5f7520f 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/DuplicateMessageException.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/DuplicateMessageException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2025 Sonu Kumar
+ * Copyright (c) 2015-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
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 4284c29a..3f57482f 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/OverrideException.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/OverrideException.java
index e6c14bb7..532ad277 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/OverrideException.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/OverrideException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/ProcessingException.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/ProcessingException.java
index d2162ba1..0315d512 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/ProcessingException.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/ProcessingException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/QueueDoesNotExist.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/QueueDoesNotExist.java
index 7fcdc86c..d5a20505 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/QueueDoesNotExist.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/QueueDoesNotExist.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/TimedOutException.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/TimedOutException.java
index f899ee98..a246933b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/TimedOutException.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/TimedOutException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/UnknownSwitchCase.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/UnknownSwitchCase.java
index fab37c76..6c00667e 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/UnknownSwitchCase.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/exception/UnknownSwitchCase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/DefaultRqueuePoller.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/DefaultRqueuePoller.java
index 8d8359b4..b9c3806d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/DefaultRqueuePoller.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/DefaultRqueuePoller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2024 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -81,7 +81,9 @@ private void logNotAvailable() {
if (Objects.isNull(lastNotAvailableAt)) {
lastNotAvailableAt = System.currentTimeMillis();
} else if (System.currentTimeMillis() - lastNotAvailableAt > maxNotAvailableDelay) {
- log(Level.ERROR, "deadlock?? frozen?? stuck?? No Threads are available in last {}",
+ log(
+ Level.ERROR,
+ "deadlock?? frozen?? stuck?? No Threads are available in last {}",
null,
Duration.ofMillis(maxNotAvailableDelay));
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/HardStrictPriorityPoller.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/HardStrictPriorityPoller.java
index 41e627fa..54386b2a 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/HardStrictPriorityPoller.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/HardStrictPriorityPoller.java
@@ -70,20 +70,16 @@ class HardStrictPriorityPoller extends RqueueMessagePoller {
this.rqueueBeanProvider = rqueueBeanProvider;
// Sort queues by priority once during initialization
List queueDetailList = new ArrayList<>(queueDetails);
- queueDetailList.sort(
- (o1, o2) ->
- o2.getPriority().get(Constants.DEFAULT_PRIORITY_KEY)
- - o1.getPriority().get(Constants.DEFAULT_PRIORITY_KEY));
+ queueDetailList.sort((o1, o2) -> o2.getPriority().get(Constants.DEFAULT_PRIORITY_KEY)
+ - o1.getPriority().get(Constants.DEFAULT_PRIORITY_KEY));
this.queues = queueDetailList.stream().map(QueueDetail::getName).collect(Collectors.toList());
- this.queueNameToDetail =
- queueDetailList.stream()
- .collect(Collectors.toMap(QueueDetail::getName, Function.identity()));
+ this.queueNameToDetail = queueDetailList.stream()
+ .collect(Collectors.toMap(QueueDetail::getName, Function.identity()));
this.queueNameToThread = queueNameToThread;
- this.hardStrictPriorityPollerProperties =
- hardStrictPriorityPollerProperties != null
- ? hardStrictPriorityPollerProperties
- : new HardStrictPriorityPollerProperties();
+ this.hardStrictPriorityPollerProperties = hardStrictPriorityPollerProperties != null
+ ? hardStrictPriorityPollerProperties
+ : new HardStrictPriorityPollerProperties();
}
@Override
@@ -153,11 +149,10 @@ boolean existMessagesInCurrentQueueOrHigherPriorityQueue(
}
protected boolean existAvailableMessagesForPoll(QueueDetail queueDetail) {
- boolean readyMessagesExists =
- rqueueBeanProvider
- .getRqueueMessageTemplate()
- .findFirstElementFromList(queueDetail.getQueueName())
- .isPresent();
+ boolean readyMessagesExists = rqueueBeanProvider
+ .getRqueueMessageTemplate()
+ .findFirstElementFromList(queueDetail.getQueueName())
+ .isPresent();
if (readyMessagesExists) {
log(
Level.TRACE,
@@ -169,12 +164,11 @@ protected boolean existAvailableMessagesForPoll(QueueDetail queueDetail) {
// Only check delayed messages with score <= current time
long currentTime = System.currentTimeMillis();
- boolean delayedMessagesExists =
- rqueueBeanProvider
- .getRqueueMessageTemplate()
- .findFirstElementFromZsetWithScore(queueDetail.getScheduledQueueName())
- .filter(element -> element.getScore() <= currentTime)
- .isPresent();
+ boolean delayedMessagesExists = rqueueBeanProvider
+ .getRqueueMessageTemplate()
+ .findFirstElementFromZsetWithScore(queueDetail.getScheduledQueueName())
+ .filter(element -> element.getScore() <= currentTime)
+ .isPresent();
if (delayedMessagesExists) {
log(
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/JobImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/JobImpl.java
index ec8fe62d..533ee736 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/JobImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/JobImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2025 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -143,9 +143,8 @@ public void checkIn(Serializable message) {
@Override
public Duration getVisibilityTimeout() {
- Long score =
- rqueueMessageTemplate.getScore(
- queueDetail.getProcessingQueueName(), rqueueJob.getRqueueMessage());
+ Long score = rqueueMessageTemplate.getScore(
+ queueDetail.getProcessingQueueName(), rqueueJob.getRqueueMessage());
if (score == null || score <= 0) {
return Duration.ZERO;
}
@@ -341,24 +340,22 @@ void updateMessageStatus(MessageStatus messageStatus) {
// run in parallel due to failure)]
if (!messageStatus.isTerminalState() || getRqueueMessage().isPeriodic()) {
Duration duration = rqueueConfig.getMessageDurability(getRqueueMessage().getPeriod());
- saveMessageMetadata(
- () -> {
- messageMetadataService.save(getMessageMetadata(), duration, false);
- return null;
- });
+ saveMessageMetadata(() -> {
+ messageMetadataService.save(getMessageMetadata(), duration, false);
+ return null;
+ });
} else {
long ttl = rqueueConfig.getMessageDurabilityInMinute();
if (ttl <= 0 || !rqueueConfig.messageInTerminalStateShouldBeStored()) {
this.messageMetadataService.delete(rqueueJob.getMessageMetadata().getId());
} else {
- saveMessageMetadata(
- () -> {
- messageMetadataService.saveMessageMetadataForQueue(
- queueDetail.getCompletedQueueName(),
- getMessageMetadata(),
- rqueueConfig.messageDurabilityInTerminalStateInMillisecond());
- return null;
- });
+ saveMessageMetadata(() -> {
+ messageMetadataService.saveMessageMetadataForQueue(
+ queueDetail.getCompletedQueueName(),
+ getMessageMetadata(),
+ rqueueConfig.messageDurabilityInTerminalStateInMillisecond());
+ return null;
+ });
}
}
save();
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MappingInformation.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MappingInformation.java
index c312e78f..9fec1488 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MappingInformation.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MappingInformation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2024 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ class MappingInformation implements Comparable {
@EqualsAndHashCode.Include
private final Set queueNames;
+
private final int numRetry;
private final String deadLetterQueueName;
private final boolean deadLetterConsumerEnabled;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MessageContainerBase.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MessageContainerBase.java
index b2eca402..09e2ca9c 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MessageContainerBase.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MessageContainerBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MessageProcessorHandler.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MessageProcessorHandler.java
index 7f11b843..e8e37c4c 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MessageProcessorHandler.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/MessageProcessorHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
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 07dad13b..e9b18dca 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2024 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -29,12 +29,11 @@
import com.github.sonus21.rqueue.utils.RedisUtils;
import com.github.sonus21.rqueue.utils.backoff.FixedTaskExecutionBackOff;
import com.github.sonus21.rqueue.utils.backoff.TaskExecutionBackOff;
+import java.io.Serializable;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.event.Level;
import org.springframework.context.ApplicationEventPublisher;
-import java.io.Serializable;
-
@Slf4j
@SuppressWarnings("java:S107")
class PostProcessingHandler extends PrefixLogger {
@@ -62,15 +61,12 @@ class PostProcessingHandler extends PrefixLogger {
this.rqueueSystemConfigDao = rqueueSystemConfigDao;
}
- long backOff(RqueueMessage rqueueMessage, Object userMessage, int failureCount,
- Throwable throwable) {
+ long backOff(
+ RqueueMessage rqueueMessage, Object userMessage, int failureCount, Throwable throwable) {
return taskExecutionBackoff.nextBackOff(userMessage, rqueueMessage, failureCount, throwable);
}
- void handle(JobImpl job,
- ExecutionStatus status,
- int failureCount,
- Throwable throwable) {
+ void handle(JobImpl job, ExecutionStatus status, int failureCount, Throwable throwable) {
try {
switch (status) {
case QUEUE_INACTIVE:
@@ -143,8 +139,7 @@ private void moveMessageToQueue(
RqueueMessage newMessage,
long delay) {
RedisUtils.executePipeLine(
- rqueueMessageTemplate.getTemplate(),
- (connection, keySerializer, valueSerializer) -> {
+ rqueueMessageTemplate.getTemplate(), (connection, keySerializer, valueSerializer) -> {
byte[] newMessageBytes = valueSerializer.serialize(newMessage);
byte[] oldMessageBytes = valueSerializer.serialize(oldMessage);
byte[] processingQueueNameBytes =
@@ -170,7 +165,8 @@ private void moveMessageToDlq(JobImpl job, int failureCount, Throwable throwable
job.getRqueueMessage(),
job.getQueueDetail().getDeadLetterQueueName());
RqueueMessage rqueueMessage = job.getRqueueMessage();
- RqueueMessage newMessage = rqueueMessage.toBuilder().failureCount(failureCount).build();
+ RqueueMessage newMessage =
+ rqueueMessage.toBuilder().failureCount(failureCount).build();
newMessage.updateReEnqueuedAt();
QueueDetail queueDetail = job.getQueueDetail();
Object userMessage = job.getMessage();
@@ -284,9 +280,8 @@ private void handleFailure(JobImpl job, int failureCount, Throwable throwable) {
} else {
int maxRetryCount = getMaxRetryCount(job.getRqueueMessage(), job.getQueueDetail());
if (failureCount < maxRetryCount) {
- long delay =
- taskExecutionBackoff.nextBackOff(job.getMessage(), job.getRqueueMessage(), failureCount,
- throwable);
+ long delay = taskExecutionBackoff.nextBackOff(
+ job.getMessage(), job.getRqueueMessage(), failureCount, throwable);
if (delay == TaskExecutionBackOff.STOP) {
handleRetryExceededMessage(job, failureCount, throwable);
} else {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/QueueDetail.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/QueueDetail.java
index e5f93c84..a57f2e2e 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/QueueDetail.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/QueueDetail.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2024 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -52,8 +52,10 @@ public class QueueDetail extends SerializableBase {
private final long visibilityTimeout;
private final String name;
private final int numRetry;
+
@Builder.Default
private final QueueType type = QueueType.QUEUE;
+
private final String queueName;
private final String deadLetterQueueName;
private final boolean deadLetterConsumerEnabled;
@@ -80,23 +82,22 @@ public DeadLetterQueue getDeadLetterQueue() {
}
public QueueConfig toConfig() {
- QueueConfig queueConfig =
- QueueConfig.builder()
- .name(name)
- .numRetry(numRetry)
- .queueName(queueName)
- .scheduledQueueName(scheduledQueueName)
- .processingQueueName(processingQueueName)
- .completedQueueName(completedQueueName)
- .visibilityTimeout(visibilityTimeout)
- .createdOn(System.currentTimeMillis())
- .updatedOn(System.currentTimeMillis())
- .deadLetterQueues(new LinkedList<>())
- .concurrency(concurrency.toMinMax())
- .priority(Collections.unmodifiableMap(priority))
- .priorityGroup(priorityGroup)
- .systemGenerated(systemGenerated)
- .build();
+ QueueConfig queueConfig = QueueConfig.builder()
+ .name(name)
+ .numRetry(numRetry)
+ .queueName(queueName)
+ .scheduledQueueName(scheduledQueueName)
+ .processingQueueName(processingQueueName)
+ .completedQueueName(completedQueueName)
+ .visibilityTimeout(visibilityTimeout)
+ .createdOn(System.currentTimeMillis())
+ .updatedOn(System.currentTimeMillis())
+ .deadLetterQueues(new LinkedList<>())
+ .concurrency(concurrency.toMinMax())
+ .priority(Collections.unmodifiableMap(priority))
+ .priorityGroup(priorityGroup)
+ .systemGenerated(systemGenerated)
+ .build();
if (isDlqSet()) {
queueConfig.addDeadLetterQueue(getDeadLetterQueue());
}
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 0613a677..ed850bd3 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2024 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -76,15 +76,10 @@ class RqueueExecutor extends MessageContainerBase {
}
private Object getUserMessage() {
- Message tmpMessage =
- MessageBuilder.createMessage(
- rqueueMessage.getMessage(),
- buildMessageHeaders(
- queueDetail.getName(),
- rqueueMessage,
- null,
- null,
- rqueueMessage.getMessageHeaders()));
+ Message tmpMessage = MessageBuilder.createMessage(
+ rqueueMessage.getMessage(),
+ buildMessageHeaders(
+ queueDetail.getName(), rqueueMessage, null, null, rqueueMessage.getMessageHeaders()));
// here error can occur when message can not be deserialized without target class information
try {
return RqueueMessageUtils.convertMessageToObject(
@@ -99,18 +94,17 @@ private void init() {
MessageMetadata messageMetadata =
beanProvider.getRqueueMessageMetadataService().getOrCreateMessageMetadata(rqueueMessage);
this.userMessage = getUserMessage();
- this.job =
- new JobImpl(
- beanProvider.getRqueueConfig(),
- beanProvider.getRqueueMessageMetadataService(),
- beanProvider.getRqueueJobDao(),
- beanProvider.getRqueueMessageTemplate(),
- beanProvider.getRqueueLockManager(),
- queueDetail,
- messageMetadata,
- rqueueMessage,
- userMessage,
- postProcessingHandler);
+ this.job = new JobImpl(
+ beanProvider.getRqueueConfig(),
+ beanProvider.getRqueueMessageMetadataService(),
+ beanProvider.getRqueueJobDao(),
+ beanProvider.getRqueueMessageTemplate(),
+ beanProvider.getRqueueLockManager(),
+ queueDetail,
+ messageMetadata,
+ rqueueMessage,
+ userMessage,
+ postProcessingHandler);
this.failureCount = job.getRqueueMessage().getFailureCount();
}
@@ -145,17 +139,20 @@ private boolean isMessageDeleted() {
boolean deleted = messageMetadata.isDeleted();
if (!deleted) {
// fetch latest from DB
- MessageMetadata newMessageMetadata =
- beanProvider
- .getRqueueMessageMetadataService()
- .getOrCreateMessageMetadata(job.getRqueueMessage());
+ MessageMetadata newMessageMetadata = beanProvider
+ .getRqueueMessageMetadataService()
+ .getOrCreateMessageMetadata(job.getRqueueMessage());
messageMetadata.merge(newMessageMetadata);
}
deleted = messageMetadata.isDeleted();
if (deleted) {
if (rqueueMessage.isPeriodic()) {
- log(Level.INFO, "Periodic Message {} having period {} has been deleted", null,
- rqueueMessage.getId(), rqueueMessage.getPeriod());
+ log(
+ Level.INFO,
+ "Periodic Message {} having period {} has been deleted",
+ null,
+ rqueueMessage.getId(),
+ rqueueMessage.getPeriod());
} else {
log(Level.INFO, "Message {} has been deleted", null, rqueueMessage.getId());
}
@@ -170,7 +167,7 @@ private boolean shouldIgnore() {
private boolean isOldMessage() {
return job.getMessageMetadata().getRqueueMessage() != null
&& job.getMessageMetadata().getRqueueMessage().getQueuedTime()
- != job.getRqueueMessage().getQueuedTime();
+ != job.getRqueueMessage().getQueuedTime();
}
private int getRetryCount() {
@@ -215,7 +212,8 @@ private void logExecutionTimeWarning(long maxProcessingTime, long startTime) {
long executionTime = System.currentTimeMillis() - startTime;
log(
Level.WARN,
- "Message listener is taking longer time [Queue: {}, TaskStatus: {}] MaxAllowedTime: {}, ExecutionTime: {}",
+ "Message listener is taking longer time [Queue: {}, TaskStatus: {}] MaxAllowedTime: {},"
+ + " ExecutionTime: {}",
null,
job.getQueueDetail().getName(),
status,
@@ -239,14 +237,10 @@ private void callMiddlewares(int currentIndex, List middlewares, Job
if (currentIndex == middlewares.size()) {
new HandlerMiddleware(beanProvider.getRqueueMessageHandler()).handle(job, null);
} else {
- middlewares
- .get(currentIndex)
- .handle(
- job,
- () -> {
- callMiddlewares(currentIndex + 1, middlewares, job);
- return null;
- });
+ middlewares.get(currentIndex).handle(job, () -> {
+ callMiddlewares(currentIndex + 1, middlewares, job);
+ return null;
+ });
}
}
@@ -278,11 +272,10 @@ private void execute() {
}
}
-
private boolean shouldRetry(long maxProcessingTime, int retryCount, int failureCount) {
- if (retryCount > 0 &&
- ExecutionStatus.FAILED.equals(status) &&
- System.currentTimeMillis() < maxProcessingTime) {
+ if (retryCount > 0
+ && ExecutionStatus.FAILED.equals(status)
+ && System.currentTimeMillis() < maxProcessingTime) {
boolean doNoRetry = queueDetail.isDoNotRetryError(error);
// it should not be retried based on the exception list
if (doNoRetry) {
@@ -346,10 +339,9 @@ private void schedulePeriodicMessage() {
if (isMessageDeleted()) {
return;
}
- RqueueMessage newMessage =
- job.getRqueueMessage().toBuilder()
- .processAt(job.getRqueueMessage().nextProcessAt())
- .build();
+ RqueueMessage newMessage = job.getRqueueMessage().toBuilder()
+ .processAt(job.getRqueueMessage().nextProcessAt())
+ .build();
String messageKey = getScheduledMessageKey(newMessage);
long expiryInSeconds = getTtlForScheduledMessageKey(newMessage);
log(
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageHandler.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageHandler.java
index effd8384..510e93b6 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageHandler.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2024 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@
import com.github.sonus21.rqueue.utils.ThreadUtils;
import com.github.sonus21.rqueue.utils.ValueResolver;
import com.google.common.annotations.VisibleForTesting;
-
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
@@ -48,7 +47,6 @@
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -83,503 +81,490 @@
@Slf4j
public class RqueueMessageHandler extends AbstractMethodMessageHandler {
- private final ConversionService conversionService;
- @Getter
- private final MessageConverter messageConverter;
- private final boolean inspectAllBean;
- private final AsyncTaskExecutor asyncTaskExecutor;
- private final Map destinationLookup = new HashMap<>(64);
- private final MultiValueMap handlerMethods =
- new LinkedMultiValueMap<>(64);
-
- public RqueueMessageHandler(final MessageConverter messageConverter, boolean inspectAllBean) {
- notNull(messageConverter, "messageConverter cannot be null");
- this.messageConverter = messageConverter;
- this.inspectAllBean = inspectAllBean;
- this.conversionService = new DefaultFormattingConversionService();
- this.asyncTaskExecutor =
- ThreadUtils.createTaskExecutor("rqueueMessageExecutor", "multiMessageExecutor-", -1, -1, 0);
- }
-
-
- @VisibleForTesting
- public RqueueMessageHandler() {
- this(new DefaultRqueueMessageConverter());
- }
-
- public RqueueMessageHandler(final MessageConverter messageConverter) {
- this(messageConverter, true);
- }
-
- private ConfigurableBeanFactory getBeanFactory() {
- ApplicationContext context = getApplicationContext();
- return (context instanceof ConfigurableApplicationContext
- ? ((ConfigurableApplicationContext) context).getBeanFactory()
- : null);
- }
-
- @Override
- protected List extends HandlerMethodArgumentResolver> initArgumentResolvers() {
- List resolvers = new ArrayList<>(getCustomArgumentResolvers());
- // Annotation-based argument resolution
- resolvers.add(new HeaderMethodArgumentResolver(this.conversionService, getBeanFactory()));
- resolvers.add(new HeadersMethodArgumentResolver());
-
- // Type-based argument resolution
- resolvers.add(new PrincipalMethodArgumentResolver());
- resolvers.add(new MessageMethodArgumentResolver(messageConverter));
- resolvers.add(new PayloadMethodArgumentResolver(messageConverter));
- return resolvers;
- }
-
-
- @Override
- protected List extends HandlerMethodReturnValueHandler> initReturnValueHandlers() {
- return new ArrayList<>(getCustomReturnValueHandlers());
- }
-
- @Override
- public void afterPropertiesSet() {
- super.afterPropertiesSet();
- for (Entry e : destinationLookup.entrySet()) {
- List handlerMethodWithPrimaries = handlerMethods.get(e.getValue());
- if (handlerMethodWithPrimaries.size() > 1) {
- if (handlerMethodWithPrimaries.stream().filter(m -> m.primary).count() != 1) {
- logger.error(
- "There must be exactly one primary listener method, queue: '" + e.getKey() + "'");
- throw new IllegalStateException("There must be exactly one primary listener method");
- }
- }
- }
- }
+ private final ConversionService conversionService;
+
+ @Getter
+ private final MessageConverter messageConverter;
+
+ private final boolean inspectAllBean;
+ private final AsyncTaskExecutor asyncTaskExecutor;
+ private final Map destinationLookup = new HashMap<>(64);
+ private final MultiValueMap handlerMethods =
+ new LinkedMultiValueMap<>(64);
+
+ public RqueueMessageHandler(final MessageConverter messageConverter, boolean inspectAllBean) {
+ notNull(messageConverter, "messageConverter cannot be null");
+ this.messageConverter = messageConverter;
+ this.inspectAllBean = inspectAllBean;
+ this.conversionService = new DefaultFormattingConversionService();
+ this.asyncTaskExecutor =
+ ThreadUtils.createTaskExecutor("rqueueMessageExecutor", "multiMessageExecutor-", -1, -1, 0);
+ }
+
+ @VisibleForTesting
+ public RqueueMessageHandler() {
+ this(new DefaultRqueueMessageConverter());
+ }
+
+ public RqueueMessageHandler(final MessageConverter messageConverter) {
+ this(messageConverter, true);
+ }
+
+ private ConfigurableBeanFactory getBeanFactory() {
+ ApplicationContext context = getApplicationContext();
+ return (context instanceof ConfigurableApplicationContext
+ ? ((ConfigurableApplicationContext) context).getBeanFactory()
+ : null);
+ }
+
+ @Override
+ protected List extends HandlerMethodArgumentResolver> initArgumentResolvers() {
+ List resolvers = new ArrayList<>(getCustomArgumentResolvers());
+ // Annotation-based argument resolution
+ resolvers.add(new HeaderMethodArgumentResolver(this.conversionService, getBeanFactory()));
+ resolvers.add(new HeadersMethodArgumentResolver());
+
+ // Type-based argument resolution
+ resolvers.add(new PrincipalMethodArgumentResolver());
+ resolvers.add(new MessageMethodArgumentResolver(messageConverter));
+ resolvers.add(new PayloadMethodArgumentResolver(messageConverter));
+ return resolvers;
+ }
+
+ @Override
+ protected List extends HandlerMethodReturnValueHandler> initReturnValueHandlers() {
+ return new ArrayList<>(getCustomReturnValueHandlers());
+ }
+
+ @Override
+ public void afterPropertiesSet() {
+ super.afterPropertiesSet();
+ for (Entry e : destinationLookup.entrySet()) {
+ List handlerMethodWithPrimaries = handlerMethods.get(e.getValue());
+ if (handlerMethodWithPrimaries.size() > 1) {
+ if (handlerMethodWithPrimaries.stream().filter(m -> m.primary).count() != 1) {
+ logger.error(
+ "There must be exactly one primary listener method, queue: '" + e.getKey() + "'");
+ throw new IllegalStateException("There must be exactly one primary listener method");
+ }
+ }
+ }
+ }
+
+ private boolean isMessageHandler(Class> beanType) {
+ RqueueListener rqueueListener = AnnotationUtils.findAnnotation(beanType, RqueueListener.class);
+ if (rqueueListener != null) {
+ MappingInformation information = getMappingInformation(rqueueListener);
+ Map methods = MethodIntrospector.selectMethods(
+ beanType, (MethodIntrospector.MetadataLookup)
+ method -> getMappingInformation(method, information));
+ Object handler = Objects.requireNonNull(getBeanFactory()).getBean(beanType);
+ methods.forEach((key, value) -> registerHandlerMethod(handler, key, value));
+ }
+ return rqueueListener != null;
+ }
+
+ @Override
+ protected boolean isHandler(Class> beanType) {
+ if (isMessageHandler(beanType)) {
+ return false;
+ }
+ if (inspectAllBean) {
+ return true;
+ }
+ return AnnotatedElementUtils.hasAnnotation(beanType, MessageListener.class);
+ }
+
+ public MultiValueMap getHandlerMethodMap() {
+ return handlerMethods;
+ }
+
+ private void addMatchesToCollection(
+ MappingInformation mapping, Message> message, Set matches) {
+ MappingInformation match = getMatchingMapping(mapping, message);
+ if (match != null) {
+ for (HandlerMethodWithPrimary method : getHandlerMethodMap().get(mapping)) {
+ matches.add(new Match(match, method));
+ }
+ }
+ }
+
+ @Override
+ protected void registerHandlerMethod(Object handler, Method method, MappingInformation mapping) {
+ for (String pattern : getDirectLookupDestinations(mapping)) {
+ MappingInformation oldMapping = destinationLookup.get(pattern);
+ if (oldMapping != null && !oldMapping.equals(mapping)) {
+ List methods = handlerMethods.get(oldMapping);
+ throw new IllegalStateException("More than one listeners are registered to same queue\n"
+ + "Existing Methods "
+ + methods
+ + "\nNew Method: ["
+ + method
+ + "]");
+ }
+ this.destinationLookup.put(pattern, mapping);
+ }
+ this.handlerMethods.add(
+ mapping,
+ new HandlerMethodWithPrimary(createHandlerMethod(handler, method), mapping.isPrimary()));
+ }
+
+ @Override
+ protected void handleMessageInternal(Message> message, String lookupDestination) {
+ MappingInformation mapping = this.destinationLookup.get(lookupDestination);
+ Set matches = new HashSet<>();
+ addMatchesToCollection(mapping, message, matches);
+ if (matches.isEmpty()) {
+ handleNoMatch(this.getHandlerMethodMap().keySet(), lookupDestination, message);
+ return;
+ }
+ executeMatches(matches, message, lookupDestination);
+ }
+
+ private void executeMultipleMatch(
+ List matches, Message> message, String lookupDestination) {
+ Match primaryMatch = null;
+ for (Match match : matches) {
+ if (match.handlerMethod.primary) {
+ primaryMatch = match;
+ }
+ }
+ if (primaryMatch == null) {
+ throw new IllegalStateException("At least one of them must be primary");
+ }
+ for (Match match : matches) {
+ if (!match.handlerMethod.primary) {
+ Message> clonedMessage = cloneMessage(message);
+ asyncTaskExecutor.execute(new MultiHandler(match, clonedMessage, lookupDestination));
+ }
+ }
+ handleMatch(
+ primaryMatch.information, primaryMatch.handlerMethod.method, lookupDestination, message);
+ }
+
+ private void executeMatches(Set matchesIn, Message> message, String lookupDestination) {
+ List matches = new ArrayList<>(matchesIn);
+ if (matches.size() == 1) {
+ Match match = matches.get(0);
+ handleMatch(match.information, match.handlerMethod.method, lookupDestination, message);
+ } else {
+ executeMultipleMatch(matches, message, lookupDestination);
+ }
+ }
+
+ private MappingInformation getMappingInformation(
+ Method method, MappingInformation mappingInformation) {
+ RqueueHandler rqueueHandler = AnnotationUtils.findAnnotation(method, RqueueHandler.class);
+ if (rqueueHandler == null) {
+ return null;
+ }
+ return mappingInformation.toBuilder().primary(rqueueHandler.primary()).build();
+ }
+
+ private MappingInformation getMappingInformation(RqueueListener rqueueListener) {
+ Set queueNames = resolveQueueNames(rqueueListener);
+ String deadLetterQueueName = resolveDeadLetterQueue(rqueueListener);
+ int numRetries = resolveNumRetries(rqueueListener);
+ long visibilityTimeout = resolveVisibilityTimeout(rqueueListener);
+ boolean active = isActive(rqueueListener);
+ boolean consumerEnabled = resolveConsumerEnabled(rqueueListener);
+ Concurrency concurrency = resolveConcurrency(rqueueListener);
+ Map priorityMap = resolvePriority(rqueueListener);
+ String priorityGroup = resolvePriorityGroup(rqueueListener);
+ int batchSize = getBatchSize(rqueueListener, concurrency);
+ MappingInformation mappingInformation = MappingInformation.builder()
+ .active(active)
+ .concurrency(concurrency)
+ .deadLetterQueueName(deadLetterQueueName)
+ .deadLetterConsumerEnabled(consumerEnabled)
+ .numRetry(numRetries)
+ .queueNames(queueNames)
+ .visibilityTimeout(visibilityTimeout)
+ .priorityGroup(priorityGroup)
+ .priority(priorityMap)
+ .batchSize(batchSize)
+ .doNotRetry(new HashSet<>(Arrays.asList(rqueueListener.doNotRetry())))
+ .build();
+ if (mappingInformation.isValid()) {
+ return mappingInformation;
+ }
+ logger.warn("Invalid Queue '" + mappingInformation + "' configuration");
+ return null;
+ }
+
+ private int getBatchSize(RqueueListener rqueueListener, Concurrency concurrency) {
+ int val =
+ ValueResolver.resolveKeyToInteger(getApplicationContext(), rqueueListener.batchSize());
+ // batch size is not set
+ if (val < Constants.MIN_BATCH_SIZE) {
+ // concurrency is set but batch size is not set, use default batch size
+ if (concurrency.isValid()) {
+ val = Constants.BATCH_SIZE_FOR_CONCURRENCY_BASED_LISTENER;
+ } else {
+ val = Constants.MIN_BATCH_SIZE;
+ }
+ }
+ return val;
+ }
+
+ @Override
+ protected MappingInformation getMappingForMethod(Method method, Class> handlerType) {
+ RqueueListener rqueueListener = AnnotationUtils.findAnnotation(method, RqueueListener.class);
+ if (rqueueListener != null) {
+ return getMappingInformation(rqueueListener);
+ }
+ return null;
+ }
+
+ private Concurrency resolveConcurrency(RqueueListener rqueueListener) {
+ String val =
+ ValueResolver.resolveKeyToString(getApplicationContext(), rqueueListener.concurrency());
+ if (val.equals("-1")) {
+ return new Concurrency(-1, -1);
+ }
+ String[] vals = val.split("-");
+ if (vals.length > 2 || vals.length == 0) {
+ throw new IllegalStateException(
+ "Concurrency must be either some number e.g. 5 or in the form of 5-10");
+ }
+ if (vals.length == 1) {
+ int concurrency =
+ parseInt(vals[0], "Concurrency is not a number", "Concurrency is not a number");
+ return new Concurrency(1, concurrency);
+ }
+ int lowerLimit = parseInt(
+ vals[0],
+ "Concurrency lower limit is not a number",
+ "Concurrency lower limit must be non-zero");
+ if (lowerLimit < Constants.MIN_CONCURRENCY) {
+ throw new IllegalStateException("lower limit of concurrency must be greater than or equal to "
+ + Constants.MIN_CONCURRENCY);
+ }
+ int upperLimit = parseInt(
+ vals[1],
+ "Concurrency upper limit is not a number",
+ "Concurrency upper limit must be non-zero");
+ if (lowerLimit > upperLimit) {
+ throw new IllegalStateException("upper limit of concurrency is smaller than the lower limit");
+ }
+ return new Concurrency(lowerLimit, upperLimit);
+ }
+
+ private String resolvePriorityGroup(RqueueListener rqueueListener) {
+ return ValueResolver.resolveKeyToString(
+ getApplicationContext(), rqueueListener.priorityGroup());
+ }
+
+ private int parseInt(String txt, String message, String nonZeroText) {
+ try {
+ int n = Integer.parseInt(txt);
+ if (n <= 0) {
+ throw new IllegalStateException(nonZeroText);
+ }
+ return n;
+ } catch (NumberFormatException e) {
+ throw new IllegalStateException(message, e);
+ }
+ }
+
+ private Map resolvePriority(RqueueListener rqueueListener) {
+ String[] priorities = ValueResolver.resolveKeyToArrayOfStrings(
+ getApplicationContext(), rqueueListener.priority());
+ HashMap priorityMap = new HashMap<>();
+ if (priorities.length == 0 || (priorities[0].equals(Constants.BLANK))) {
+ return priorityMap;
+ }
+ for (String priority : priorities) {
+ String[] vals = priority.split(":");
+ if (vals.length == 1) {
+ vals = priority.split("=");
+ }
+ if (vals.length == 1) {
+ if (!priorityMap.isEmpty()) {
+ throw new IllegalStateException("Invalid priority configuration is used.");
+ }
+ priorityMap.put(
+ Constants.DEFAULT_PRIORITY_KEY,
+ parseInt(
+ vals[0],
+ "priority is not a number.",
+ "priority must be greater than or equal to 1"));
+ } else if (vals.length == 2) {
+ priorityMap.put(
+ vals[0],
+ parseInt(
+ vals[1],
+ "priority is not a number.",
+ "priority must be greater than or equal to 1"));
+ } else {
+ throw new IllegalStateException("Priority cannot be parsed");
+ }
+ }
+ return Collections.unmodifiableMap(priorityMap);
+ }
+
+ private boolean resolveConsumerEnabled(RqueueListener rqueueListener) {
+ return ValueResolver.resolveToBoolean(
+ getApplicationContext(), rqueueListener.deadLetterQueueListenerEnabled());
+ }
+
+ private long resolveVisibilityTimeout(RqueueListener rqueueListener) {
+ long value =
+ ValueResolver.resolveKeyToLong(getApplicationContext(), rqueueListener.visibilityTimeout());
+ if (value < Constants.MIN_VISIBILITY) {
+ throw new IllegalStateException(
+ "Visibility must be greater than or equal to " + Constants.MIN_VISIBILITY);
+ }
+ return value;
+ }
+
+ private int resolveNumRetries(RqueueListener rqueueListener) {
+ return ValueResolver.resolveKeyToInteger(getApplicationContext(), rqueueListener.numRetries());
+ }
+
+ private String resolveDeadLetterQueue(RqueueListener rqueueListener) {
+ String dlqName = rqueueListener.deadLetterQueue();
+ String[] resolvedValues =
+ ValueResolver.resolveKeyToArrayOfStrings(getApplicationContext(), dlqName);
+ if (resolvedValues.length == 1) {
+ return resolvedValues[0];
+ }
+ throw new IllegalStateException(
+ "more than one dead letter queue cannot be configured '" + dlqName + "'");
+ }
+
+ private boolean isActive(RqueueListener rqueueListener) {
+ return ValueResolver.resolveToBoolean(getApplicationContext(), rqueueListener.active());
+ }
+
+ private void checkInvalidQueueName(Set queueNames) {
+ List invalidNames = new LinkedList<>();
+ Character[] invalidChars = new Character[] {
+ '{', '}', ' ', '<', '>',
+ };
+ for (String queue : queueNames) {
+ for (int i = 0; i < queue.length(); i++) {
+ for (char invalidChar : invalidChars) {
+ if (queue.charAt(i) == invalidChar) {
+ invalidNames.add(queue);
+ break;
+ }
+ }
+ }
+ }
+ if (!invalidNames.isEmpty()) {
+ String invalidCharsStr = Stream.of(invalidChars)
+ .map(e -> String.format("'%c'", e))
+ .collect(Collectors.joining(Constants.Comma));
+ String queueNamesStr = invalidNames.stream()
+ .map(e -> String.format("'%s'", e))
+ .collect(Collectors.joining(Constants.Comma));
+ String message = String.format(
+ "Queue name contains invalid char%n Not Allowed Chars [%s] %n Queues: [%s]",
+ invalidCharsStr, queueNamesStr);
+ throw new IllegalStateException(message);
+ }
+ }
+
+ private Set resolveQueueNames(RqueueListener rqueueListener) {
+ String[] queueNames = rqueueListener.value();
+ Set result = new HashSet<>(queueNames.length);
+ for (String queueName : queueNames) {
+ result.addAll(Arrays.asList(
+ ValueResolver.resolveKeyToArrayOfStrings(getApplicationContext(), queueName)));
+ }
+ checkInvalidQueueName(result);
+ return Collections.unmodifiableSet(result);
+ }
+
+ @Override
+ protected Set getDirectLookupDestinations(MappingInformation mapping) {
+ Set destinations = new HashSet<>(mapping.getQueueNames());
+ for (String queueName : mapping.getQueueNames()) {
+ destinations.addAll(PriorityUtils.getNamesFromPriority(queueName, mapping.getPriority()));
+ }
+ return destinations;
+ }
+
+ @Override
+ protected String getDestination(Message> message) {
+ return (String) message.getHeaders().get(RqueueMessageHeaders.DESTINATION);
+ }
+
+ @Override
+ protected MappingInformation getMatchingMapping(MappingInformation mapping, Message> message) {
+ String destination = getDestination(message);
+ if (mapping.getQueueNames().contains(destination)) {
+ return mapping;
+ }
+ try {
+ QueueDetail queueDetail = EndpointRegistry.get(destination);
+ if (queueDetail.isSystemGenerated()) {
+ queueDetail = EndpointRegistry.get(queueDetail.getPriorityGroup());
+ if (mapping.getQueueNames().contains(queueDetail.getName())) {
+ return mapping;
+ }
+ }
+ } catch (QueueDoesNotExist e) {
+ return null;
+ }
+ return null;
+ }
+
+ @Override
+ protected Comparator getMappingComparator(Message> message) {
+ return new ComparableComparator<>();
+ }
+
+ @Override
+ protected AbstractExceptionHandlerMethodResolver createExceptionHandlerMethodResolverFor(
+ Class> beanType) {
+ return new AnnotationExceptionHandlerMethodResolver(beanType);
+ }
+
+ @Override
+ protected void processHandlerMethodException(
+ HandlerMethod handlerMethod, Exception ex, Message> message) {
+ super.processHandlerMethodException(handlerMethod, ex, message);
+ throw new MessagingException("An exception occurred while invoking the handler method", ex);
+ }
- private boolean isMessageHandler(Class> beanType) {
- RqueueListener rqueueListener = AnnotationUtils.findAnnotation(beanType, RqueueListener.class);
- if (rqueueListener != null) {
- MappingInformation information = getMappingInformation(rqueueListener);
- Map methods =
- MethodIntrospector.selectMethods(
- beanType,
- (MethodIntrospector.MetadataLookup)
- method -> getMappingInformation(method, information));
- Object handler = Objects.requireNonNull(getBeanFactory()).getBean(beanType);
- methods.forEach((key, value) -> registerHandlerMethod(handler, key, value));
- }
- return rqueueListener != null;
- }
-
- @Override
- protected boolean isHandler(Class> beanType) {
- if (isMessageHandler(beanType)) {
- return false;
- }
- if (inspectAllBean) {
- return true;
- }
- return AnnotatedElementUtils.hasAnnotation(beanType, MessageListener.class);
- }
-
- public MultiValueMap getHandlerMethodMap() {
- return handlerMethods;
- }
-
- private void addMatchesToCollection(
- MappingInformation mapping, Message> message, Set matches) {
- MappingInformation match = getMatchingMapping(mapping, message);
- if (match != null) {
- for (HandlerMethodWithPrimary method : getHandlerMethodMap().get(mapping)) {
- matches.add(new Match(match, method));
- }
- }
- }
-
- @Override
- protected void registerHandlerMethod(Object handler, Method method, MappingInformation mapping) {
- for (String pattern : getDirectLookupDestinations(mapping)) {
- MappingInformation oldMapping = destinationLookup.get(pattern);
- if (oldMapping != null && !oldMapping.equals(mapping)) {
- List methods = handlerMethods.get(oldMapping);
- throw new IllegalStateException(
- "More than one listeners are registered to same queue\n"
- + "Existing Methods "
- + methods
- + "\nNew Method: ["
- + method
- + "]");
- }
- this.destinationLookup.put(pattern, mapping);
- }
- this.handlerMethods.add(
- mapping,
- new HandlerMethodWithPrimary(createHandlerMethod(handler, method), mapping.isPrimary()));
- }
-
- @Override
- protected void handleMessageInternal(Message> message, String lookupDestination) {
- MappingInformation mapping = this.destinationLookup.get(lookupDestination);
- Set matches = new HashSet<>();
- addMatchesToCollection(mapping, message, matches);
- if (matches.isEmpty()) {
- handleNoMatch(this.getHandlerMethodMap().keySet(), lookupDestination, message);
- return;
- }
- executeMatches(matches, message, lookupDestination);
- }
-
- private void executeMultipleMatch(
- List matches, Message> message, String lookupDestination) {
- Match primaryMatch = null;
- for (Match match : matches) {
- if (match.handlerMethod.primary) {
- primaryMatch = match;
- }
- }
- if (primaryMatch == null) {
- throw new IllegalStateException("At least one of them must be primary");
- }
- for (Match match : matches) {
- if (!match.handlerMethod.primary) {
- Message> clonedMessage = cloneMessage(message);
- asyncTaskExecutor.execute(new MultiHandler(match, clonedMessage, lookupDestination));
- }
- }
- handleMatch(
- primaryMatch.information, primaryMatch.handlerMethod.method, lookupDestination, message);
- }
-
- private void executeMatches(Set matchesIn, Message> message, String lookupDestination) {
- List matches = new ArrayList<>(matchesIn);
- if (matches.size() == 1) {
- Match match = matches.get(0);
- handleMatch(match.information, match.handlerMethod.method, lookupDestination, message);
- } else {
- executeMultipleMatch(matches, message, lookupDestination);
- }
- }
-
- private MappingInformation getMappingInformation(
- Method method, MappingInformation mappingInformation) {
- RqueueHandler rqueueHandler = AnnotationUtils.findAnnotation(method, RqueueHandler.class);
- if (rqueueHandler == null) {
- return null;
- }
- return mappingInformation.toBuilder().primary(rqueueHandler.primary()).build();
- }
-
- private MappingInformation getMappingInformation(RqueueListener rqueueListener) {
- Set queueNames = resolveQueueNames(rqueueListener);
- String deadLetterQueueName = resolveDeadLetterQueue(rqueueListener);
- int numRetries = resolveNumRetries(rqueueListener);
- long visibilityTimeout = resolveVisibilityTimeout(rqueueListener);
- boolean active = isActive(rqueueListener);
- boolean consumerEnabled = resolveConsumerEnabled(rqueueListener);
- Concurrency concurrency = resolveConcurrency(rqueueListener);
- Map priorityMap = resolvePriority(rqueueListener);
- String priorityGroup = resolvePriorityGroup(rqueueListener);
- int batchSize = getBatchSize(rqueueListener, concurrency);
- MappingInformation mappingInformation =
- MappingInformation.builder()
- .active(active)
- .concurrency(concurrency)
- .deadLetterQueueName(deadLetterQueueName)
- .deadLetterConsumerEnabled(consumerEnabled)
- .numRetry(numRetries)
- .queueNames(queueNames)
- .visibilityTimeout(visibilityTimeout)
- .priorityGroup(priorityGroup)
- .priority(priorityMap)
- .batchSize(batchSize)
- .doNotRetry(new HashSet<>(Arrays.asList(rqueueListener.doNotRetry())))
- .build();
- if (mappingInformation.isValid()) {
- return mappingInformation;
- }
- logger.warn("Invalid Queue '" + mappingInformation + "' configuration");
- return null;
- }
-
- private int getBatchSize(RqueueListener rqueueListener, Concurrency concurrency) {
- int val =
- ValueResolver.resolveKeyToInteger(getApplicationContext(), rqueueListener.batchSize());
- // batch size is not set
- if (val < Constants.MIN_BATCH_SIZE) {
- // concurrency is set but batch size is not set, use default batch size
- if (concurrency.isValid()) {
- val = Constants.BATCH_SIZE_FOR_CONCURRENCY_BASED_LISTENER;
- } else {
- val = Constants.MIN_BATCH_SIZE;
- }
- }
- return val;
- }
-
- @Override
- protected MappingInformation getMappingForMethod(Method method, Class> handlerType) {
- RqueueListener rqueueListener = AnnotationUtils.findAnnotation(method, RqueueListener.class);
- if (rqueueListener != null) {
- return getMappingInformation(rqueueListener);
- }
- return null;
- }
-
- private Concurrency resolveConcurrency(RqueueListener rqueueListener) {
- String val =
- ValueResolver.resolveKeyToString(getApplicationContext(), rqueueListener.concurrency());
- if (val.equals("-1")) {
- return new Concurrency(-1, -1);
- }
- String[] vals = val.split("-");
- if (vals.length > 2 || vals.length == 0) {
- throw new IllegalStateException(
- "Concurrency must be either some number e.g. 5 or in the form of 5-10");
- }
- if (vals.length == 1) {
- int concurrency =
- parseInt(vals[0], "Concurrency is not a number", "Concurrency is not a number");
- return new Concurrency(1, concurrency);
- }
- int lowerLimit =
- parseInt(
- vals[0],
- "Concurrency lower limit is not a number",
- "Concurrency lower limit must be non-zero");
- if (lowerLimit < Constants.MIN_CONCURRENCY) {
- throw new IllegalStateException(
- "lower limit of concurrency must be greater than or equal to "
- + Constants.MIN_CONCURRENCY);
- }
- int upperLimit =
- parseInt(
- vals[1],
- "Concurrency upper limit is not a number",
- "Concurrency upper limit must be non-zero");
- if (lowerLimit > upperLimit) {
- throw new IllegalStateException("upper limit of concurrency is smaller than the lower limit");
- }
- return new Concurrency(lowerLimit, upperLimit);
- }
-
- private String resolvePriorityGroup(RqueueListener rqueueListener) {
- return ValueResolver.resolveKeyToString(
- getApplicationContext(), rqueueListener.priorityGroup());
- }
-
- private int parseInt(String txt, String message, String nonZeroText) {
- try {
- int n = Integer.parseInt(txt);
- if (n <= 0) {
- throw new IllegalStateException(nonZeroText);
- }
- return n;
- } catch (NumberFormatException e) {
- throw new IllegalStateException(message, e);
- }
- }
-
- private Map resolvePriority(RqueueListener rqueueListener) {
- String[] priorities =
- ValueResolver.resolveKeyToArrayOfStrings(
- getApplicationContext(), rqueueListener.priority());
- HashMap priorityMap = new HashMap<>();
- if (priorities.length == 0 || (priorities[0].equals(Constants.BLANK))) {
- return priorityMap;
- }
- for (String priority : priorities) {
- String[] vals = priority.split(":");
- if (vals.length == 1) {
- vals = priority.split("=");
- }
- if (vals.length == 1) {
- if (!priorityMap.isEmpty()) {
- throw new IllegalStateException("Invalid priority configuration is used.");
- }
- priorityMap.put(
- Constants.DEFAULT_PRIORITY_KEY,
- parseInt(
- vals[0],
- "priority is not a number.",
- "priority must be greater than or equal to 1"));
- } else if (vals.length == 2) {
- priorityMap.put(
- vals[0],
- parseInt(
- vals[1],
- "priority is not a number.",
- "priority must be greater than or equal to 1"));
- } else {
- throw new IllegalStateException("Priority cannot be parsed");
- }
- }
- return Collections.unmodifiableMap(priorityMap);
- }
-
- private boolean resolveConsumerEnabled(RqueueListener rqueueListener) {
- return ValueResolver.resolveToBoolean(
- getApplicationContext(), rqueueListener.deadLetterQueueListenerEnabled());
- }
-
- private long resolveVisibilityTimeout(RqueueListener rqueueListener) {
- long value =
- ValueResolver.resolveKeyToLong(getApplicationContext(), rqueueListener.visibilityTimeout());
- if (value < Constants.MIN_VISIBILITY) {
- throw new IllegalStateException(
- "Visibility must be greater than or equal to " + Constants.MIN_VISIBILITY);
- }
- return value;
- }
-
- private int resolveNumRetries(RqueueListener rqueueListener) {
- return ValueResolver.resolveKeyToInteger(getApplicationContext(), rqueueListener.numRetries());
- }
-
- private String resolveDeadLetterQueue(RqueueListener rqueueListener) {
- String dlqName = rqueueListener.deadLetterQueue();
- String[] resolvedValues =
- ValueResolver.resolveKeyToArrayOfStrings(getApplicationContext(), dlqName);
- if (resolvedValues.length == 1) {
- return resolvedValues[0];
- }
- throw new IllegalStateException(
- "more than one dead letter queue cannot be configured '" + dlqName + "'");
- }
-
- private boolean isActive(RqueueListener rqueueListener) {
- return ValueResolver.resolveToBoolean(getApplicationContext(), rqueueListener.active());
- }
-
- private void checkInvalidQueueName(Set queueNames) {
- List invalidNames = new LinkedList<>();
- Character[] invalidChars =
- new Character[]{
- '{', '}', ' ', '<', '>',
- };
- for (String queue : queueNames) {
- for (int i = 0; i < queue.length(); i++) {
- for (char invalidChar : invalidChars) {
- if (queue.charAt(i) == invalidChar) {
- invalidNames.add(queue);
- break;
- }
- }
- }
- }
- if (!invalidNames.isEmpty()) {
- String invalidCharsStr =
- Stream.of(invalidChars)
- .map(e -> String.format("'%c'", e))
- .collect(Collectors.joining(Constants.Comma));
- String queueNamesStr =
- invalidNames.stream()
- .map(e -> String.format("'%s'", e))
- .collect(Collectors.joining(Constants.Comma));
- String message =
- String.format(
- "Queue name contains invalid char%n Not Allowed Chars [%s] %n Queues: [%s]",
- invalidCharsStr, queueNamesStr);
- throw new IllegalStateException(message);
- }
- }
-
- private Set resolveQueueNames(RqueueListener rqueueListener) {
- String[] queueNames = rqueueListener.value();
- Set result = new HashSet<>(queueNames.length);
- for (String queueName : queueNames) {
- result.addAll(
- Arrays.asList(
- ValueResolver.resolveKeyToArrayOfStrings(getApplicationContext(), queueName)));
- }
- checkInvalidQueueName(result);
- return Collections.unmodifiableSet(result);
- }
-
- @Override
- protected Set getDirectLookupDestinations(MappingInformation mapping) {
- Set destinations = new HashSet<>(mapping.getQueueNames());
- for (String queueName : mapping.getQueueNames()) {
- destinations.addAll(PriorityUtils.getNamesFromPriority(queueName, mapping.getPriority()));
- }
- return destinations;
- }
-
- @Override
- protected String getDestination(Message> message) {
- return (String) message.getHeaders().get(RqueueMessageHeaders.DESTINATION);
- }
-
- @Override
- protected MappingInformation getMatchingMapping(MappingInformation mapping, Message> message) {
- String destination = getDestination(message);
- if (mapping.getQueueNames().contains(destination)) {
- return mapping;
- }
- try {
- QueueDetail queueDetail = EndpointRegistry.get(destination);
- if (queueDetail.isSystemGenerated()) {
- queueDetail = EndpointRegistry.get(queueDetail.getPriorityGroup());
- if (mapping.getQueueNames().contains(queueDetail.getName())) {
- return mapping;
- }
- }
- } catch (QueueDoesNotExist e) {
- return null;
- }
- return null;
- }
+ @AllArgsConstructor
+ static class HandlerMethodWithPrimary {
- @Override
- protected Comparator getMappingComparator(Message> message) {
- return new ComparableComparator<>();
- }
+ HandlerMethod method;
+ boolean primary;
@Override
- protected AbstractExceptionHandlerMethodResolver createExceptionHandlerMethodResolverFor(
- Class> beanType) {
- return new AnnotationExceptionHandlerMethodResolver(beanType);
- }
-
- @Override
- protected void processHandlerMethodException(
- HandlerMethod handlerMethod, Exception ex, Message> message) {
- super.processHandlerMethodException(handlerMethod, ex, message);
- throw new MessagingException("An exception occurred while invoking the handler method", ex);
+ public String toString() {
+ return method.toString();
}
+ }
@AllArgsConstructor
- static class HandlerMethodWithPrimary {
+ @EqualsAndHashCode
+ private static class Match {
- HandlerMethod method;
- boolean primary;
+ private final MappingInformation information;
+ private final HandlerMethodWithPrimary handlerMethod;
+ }
- @Override
- public String toString() {
- return method.toString();
- }
- }
+ private class MultiHandler extends RetryableRunnable {
- @AllArgsConstructor
- @EqualsAndHashCode
- private static class Match {
+ private final Match match;
+ private final Message> message;
+ private final String lookupDestination;
- private final MappingInformation information;
- private final HandlerMethodWithPrimary handlerMethod;
+ protected MultiHandler(Match match, Message> message, String lookupDestination) {
+ super(log, "");
+ this.match = match;
+ this.message = message;
+ this.lookupDestination = lookupDestination;
}
- private class MultiHandler extends RetryableRunnable {
-
- private final Match match;
- private final Message> message;
- private final String lookupDestination;
-
- protected MultiHandler(Match match, Message> message, String lookupDestination) {
- super(log, "");
- this.match = match;
- this.message = message;
- this.lookupDestination = lookupDestination;
- }
-
- @Override
- public void start() {
- handleMatch(match.information, match.handlerMethod.method, lookupDestination, message);
- }
+ @Override
+ public void start() {
+ handleMatch(match.information, match.handlerMethod.method, lookupDestination, message);
}
+ }
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageHeaders.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageHeaders.java
index 7404c874..33f0f395 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageHeaders.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageHeaders.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -59,8 +59,7 @@ public final class RqueueMessageHeaders {
private static final MessageHeaders emptyMessageHeaders =
new MessageHeaders(Collections.emptyMap());
- private RqueueMessageHeaders() {
- }
+ private RqueueMessageHeaders() {}
public static MessageHeaders emptyMessageHeaders() {
return emptyMessageHeaders;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageListenerContainer.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageListenerContainer.java
index 8bd7f5fc..3922c6f2 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageListenerContainer.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessageListenerContainer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2024 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -84,8 +84,10 @@ public class RqueueMessageListenerContainer
private final ConcurrentHashMap> scheduledFutureByQueue =
new ConcurrentHashMap<>();
private final Map queueThreadMap = new ConcurrentHashMap<>();
+
@Autowired
protected RqueueBeanProvider rqueueBeanProvider;
+
List middlewares;
private MessageProcessor discardMessageProcessor;
private MessageProcessor deadLetterQueueMessageProcessor;
@@ -265,10 +267,9 @@ private void initializeQueue() {
private void initializeThreadMapForNonDefaultExecutor(
List registeredActiveQueueDetail) {
- List queueDetails =
- registeredActiveQueueDetail.stream()
- .filter(e -> !e.isSystemGenerated())
- .collect(Collectors.toList());
+ List queueDetails = registeredActiveQueueDetail.stream()
+ .filter(e -> !e.isSystemGenerated())
+ .collect(Collectors.toList());
List withoutConcurrency = new ArrayList<>();
for (QueueDetail queueDetail : queueDetails) {
if (queueDetail.getConcurrency().isValid()) {
@@ -283,18 +284,17 @@ private void initializeThreadMapForNonDefaultExecutor(
private void initialize() {
initializeQueue();
- this.postProcessingHandler =
- new PostProcessingHandler(
- rqueueBeanProvider.getRqueueWebConfig(),
- rqueueBeanProvider.getApplicationEventPublisher(),
- rqueueMessageTemplate,
- taskExecutionBackOff,
- new MessageProcessorHandler(
- manualDeletionMessageProcessor,
- deadLetterQueueMessageProcessor,
- discardMessageProcessor,
- postExecutionMessageProcessor),
- rqueueBeanProvider.getRqueueSystemConfigDao());
+ this.postProcessingHandler = new PostProcessingHandler(
+ rqueueBeanProvider.getRqueueWebConfig(),
+ rqueueBeanProvider.getApplicationEventPublisher(),
+ rqueueMessageTemplate,
+ taskExecutionBackOff,
+ new MessageProcessorHandler(
+ manualDeletionMessageProcessor,
+ deadLetterQueueMessageProcessor,
+ discardMessageProcessor,
+ postExecutionMessageProcessor),
+ rqueueBeanProvider.getRqueueSystemConfigDao());
this.rqueueBeanProvider.setPreExecutionMessageProcessor(preExecutionMessageProcessor);
}
@@ -373,10 +373,9 @@ private void createExecutor(QueueDetail queueDetail) {
public AsyncTaskExecutor createDefaultTaskExecutor(
List registeredActiveQueueDetail) {
- List queueDetails =
- registeredActiveQueueDetail.stream()
- .filter(e -> !e.isSystemGenerated())
- .collect(Collectors.toList());
+ List queueDetails = registeredActiveQueueDetail.stream()
+ .filter(e -> !e.isSystemGenerated())
+ .collect(Collectors.toList());
List withoutConcurrency = new ArrayList<>();
for (QueueDetail queueDetail : queueDetails) {
if (queueDetail.getConcurrency().getMin() > 0) {
@@ -410,26 +409,25 @@ private List getQueueDetail(String queue, MappingInformation mappin
priorityGroup = Constants.DEFAULT_PRIORITY_GROUP;
}
RqueueConfig rqueueConfig = rqueueBeanProvider.getRqueueConfig();
- QueueDetail queueDetail =
- QueueDetail.builder()
- .name(queue)
- .queueName(rqueueConfig.getQueueName(queue))
- .processingQueueName(rqueueConfig.getProcessingQueueName(queue))
- .completedQueueName(rqueueConfig.getCompletedQueueName(queue))
- .scheduledQueueName(rqueueConfig.getScheduledQueueName(queue))
- .processingQueueChannelName(rqueueConfig.getProcessingQueueChannelName(queue))
- .scheduledQueueChannelName(rqueueConfig.getScheduledQueueChannelName(queue))
- .deadLetterQueueName(mappingInformation.getDeadLetterQueueName())
- .visibilityTimeout(mappingInformation.getVisibilityTimeout())
- .deadLetterConsumerEnabled(mappingInformation.isDeadLetterConsumerEnabled())
- .concurrency(mappingInformation.getConcurrency())
- .batchSize(mappingInformation.getBatchSize())
- .active(mappingInformation.isActive())
- .numRetry(numRetry)
- .priority(priority)
- .priorityGroup(priorityGroup)
- .doNotRetry(mappingInformation.getDoNotRetry())
- .build();
+ QueueDetail queueDetail = QueueDetail.builder()
+ .name(queue)
+ .queueName(rqueueConfig.getQueueName(queue))
+ .processingQueueName(rqueueConfig.getProcessingQueueName(queue))
+ .completedQueueName(rqueueConfig.getCompletedQueueName(queue))
+ .scheduledQueueName(rqueueConfig.getScheduledQueueName(queue))
+ .processingQueueChannelName(rqueueConfig.getProcessingQueueChannelName(queue))
+ .scheduledQueueChannelName(rqueueConfig.getScheduledQueueChannelName(queue))
+ .deadLetterQueueName(mappingInformation.getDeadLetterQueueName())
+ .visibilityTimeout(mappingInformation.getVisibilityTimeout())
+ .deadLetterConsumerEnabled(mappingInformation.isDeadLetterConsumerEnabled())
+ .concurrency(mappingInformation.getConcurrency())
+ .batchSize(mappingInformation.getBatchSize())
+ .active(mappingInformation.isActive())
+ .numRetry(numRetry)
+ .priority(priority)
+ .priorityGroup(priorityGroup)
+ .doNotRetry(mappingInformation.getDoNotRetry())
+ .build();
List queueDetails;
if (queueDetail.getPriority().size() <= 1) {
queueDetails = Collections.singletonList(queueDetail);
@@ -503,48 +501,42 @@ protected void startGroup(String groupName, List queueDetails) {
Map queueThread = getQueueThreadMap(groupName, queueDetails);
Future> future;
if (getPriorityMode() == PriorityMode.STRICT) {
- future =
- taskExecutor.submit(
- new StrictPriorityPoller(
- StringUtils.groupName(groupName),
- queueDetails,
- queueThread,
- rqueueBeanProvider,
- queueStateMgr,
- getMiddleWares(),
- pollingInterval,
- backOffTime,
- postProcessingHandler,
- getMessageHeaders()));
+ future = taskExecutor.submit(new StrictPriorityPoller(
+ StringUtils.groupName(groupName),
+ queueDetails,
+ queueThread,
+ rqueueBeanProvider,
+ queueStateMgr,
+ getMiddleWares(),
+ pollingInterval,
+ backOffTime,
+ postProcessingHandler,
+ getMessageHeaders()));
} else if (getPriorityMode() == PriorityMode.HARD_STRICT) {
- future =
- taskExecutor.submit(
- new HardStrictPriorityPoller(
- StringUtils.groupName(groupName),
- queueDetails,
- queueThread,
- rqueueBeanProvider,
- queueStateMgr,
- getMiddleWares(),
- pollingInterval,
- backOffTime,
- postProcessingHandler,
- getMessageHeaders(),
- getHardStrictPriorityPollerProperties()));
+ future = taskExecutor.submit(new HardStrictPriorityPoller(
+ StringUtils.groupName(groupName),
+ queueDetails,
+ queueThread,
+ rqueueBeanProvider,
+ queueStateMgr,
+ getMiddleWares(),
+ pollingInterval,
+ backOffTime,
+ postProcessingHandler,
+ getMessageHeaders(),
+ getHardStrictPriorityPollerProperties()));
} else {
- future =
- taskExecutor.submit(
- new WeightedPriorityPoller(
- StringUtils.groupName(groupName),
- queueDetails,
- queueThread,
- rqueueBeanProvider,
- queueStateMgr,
- getMiddleWares(),
- pollingInterval,
- backOffTime,
- postProcessingHandler,
- getMessageHeaders()));
+ future = taskExecutor.submit(new WeightedPriorityPoller(
+ StringUtils.groupName(groupName),
+ queueDetails,
+ queueThread,
+ rqueueBeanProvider,
+ queueStateMgr,
+ getMiddleWares(),
+ pollingInterval,
+ backOffTime,
+ postProcessingHandler,
+ getMessageHeaders()));
}
scheduledFutureByQueue.put(groupName, future);
}
@@ -557,17 +549,16 @@ protected void startQueue(String queueName, QueueDetail queueDetail) {
QueueConfig config = rqueueBeanProvider.getRqueueSystemConfigDao().getConfigByName(queueName);
queueStateMgr.pauseQueueIfRequired(config);
QueueThreadPool queueThreadPool = queueThreadMap.get(queueName);
- DefaultRqueuePoller messagePoller =
- new DefaultRqueuePoller(
- queueDetail,
- queueThreadPool,
- rqueueBeanProvider,
- queueStateMgr,
- getMiddleWares(),
- pollingInterval,
- backOffTime,
- postProcessingHandler,
- getMessageHeaders());
+ DefaultRqueuePoller messagePoller = new DefaultRqueuePoller(
+ queueDetail,
+ queueThreadPool,
+ rqueueBeanProvider,
+ queueStateMgr,
+ getMiddleWares(),
+ pollingInterval,
+ backOffTime,
+ postProcessingHandler,
+ getMessageHeaders());
Future> future = getTaskExecutor().submit(messagePoller);
scheduledFutureByQueue.put(queueName, future);
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessagePoller.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessagePoller.java
index 067c175c..a64bd101 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessagePoller.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/RqueueMessagePoller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -72,15 +72,14 @@ private void execute(
QueueThreadPool queueThreadPool, QueueDetail queueDetail, RqueueMessage message) {
message.setMessageHeaders(messageHeaders);
try {
- queueThreadPool.execute(
- new RqueueExecutor(
- rqueueBeanProvider,
- queueStateMgr,
- middlewares,
- postProcessingHandler,
- message,
- queueDetail,
- queueThreadPool));
+ queueThreadPool.execute(new RqueueExecutor(
+ rqueueBeanProvider,
+ queueStateMgr,
+ middlewares,
+ postProcessingHandler,
+ message,
+ queueDetail,
+ queueThreadPool));
} catch (Exception e) {
if (e instanceof TaskRejectedException) {
queueThreadPool.taskRejected(queueDetail, message);
@@ -104,7 +103,6 @@ protected boolean hasAvailableThreads(QueueDetail queueDetail, QueueThreadPool q
return queueThreadPool.availableThreads() > 0;
}
-
protected int getBatchSize(QueueDetail queueDetail, QueueThreadPool queueThreadPool) {
int batchSize = Math.min(queueDetail.getBatchSize(), queueThreadPool.availableThreads());
batchSize = Math.max(batchSize, Constants.MIN_BATCH_SIZE);
@@ -152,8 +150,7 @@ private void pollAndExecute(
}
}
- void poll(int index, String queue, QueueDetail queueDetail,
- QueueThreadPool queueThreadPool) {
+ void poll(int index, String queue, QueueDetail queueDetail, QueueThreadPool queueThreadPool) {
log(Level.TRACE, "Polling queue {}", null, queue);
int batchSize = getBatchSize(queueDetail, queueThreadPool);
boolean acquired;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/StrictPriorityPoller.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/StrictPriorityPoller.java
index bb9dad69..404bed4d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/StrictPriorityPoller.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/StrictPriorityPoller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2024 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -61,15 +61,12 @@ class StrictPriorityPoller extends RqueueMessagePoller {
postProcessingHandler,
messageHeaders);
List queueDetailList = new ArrayList<>(queueDetails);
- queueDetailList.sort(
- (o1, o2) ->
- o2.getPriority().get(Constants.DEFAULT_PRIORITY_KEY)
- - o1.getPriority().get(Constants.DEFAULT_PRIORITY_KEY));
+ queueDetailList.sort((o1, o2) -> o2.getPriority().get(Constants.DEFAULT_PRIORITY_KEY)
+ - o1.getPriority().get(Constants.DEFAULT_PRIORITY_KEY));
this.queues = queueDetailList.stream().map(QueueDetail::getName).collect(Collectors.toList());
queues.forEach(queue -> this.lastFetchedTime.put(queue, 0L));
- this.queueNameToDetail =
- queueDetailList.stream()
- .collect(Collectors.toMap(QueueDetail::getName, Function.identity()));
+ this.queueNameToDetail = queueDetailList.stream()
+ .collect(Collectors.toMap(QueueDetail::getName, Function.identity()));
this.queueNameToThread = queueNameToThread;
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/WeightedPriorityPoller.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/WeightedPriorityPoller.java
index 8f2a084e..df71480b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/WeightedPriorityPoller.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/listener/WeightedPriorityPoller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2024 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/QueueCounter.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/QueueCounter.java
index 4ee64f27..35173d19 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/QueueCounter.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/QueueCounter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2025 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -59,18 +59,16 @@ void registerQueue(
MeterRegistry registry,
QueueDetail queueDetail) {
if (metricsProperties.countFailure()) {
- Counter.Builder builder =
- Counter.builder(metricsProperties.getMetricName(FAILURE_COUNT))
- .tags(queueTags.and(QUEUE_KEY, queueDetail.getQueueName()))
- .description("Failure count");
+ Counter.Builder builder = Counter.builder(metricsProperties.getMetricName(FAILURE_COUNT))
+ .tags(queueTags.and(QUEUE_KEY, queueDetail.getQueueName()))
+ .description("Failure count");
Counter counter = builder.register(registry);
queueNameToFailureCounter.put(queueDetail.getName(), counter);
}
if (metricsProperties.countExecution()) {
- Counter.Builder builder =
- Counter.builder(metricsProperties.getMetricName(EXECUTION_COUNT))
- .tags(queueTags.and(QUEUE_KEY, queueDetail.getQueueName()))
- .description("Task execution count");
+ Counter.Builder builder = Counter.builder(metricsProperties.getMetricName(EXECUTION_COUNT))
+ .tags(queueTags.and(QUEUE_KEY, queueDetail.getQueueName()))
+ .description("Task execution count");
Counter counter = builder.register(registry);
queueNameToExecutionCounter.put(queueDetail.getName(), counter);
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueCounter.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueCounter.java
index 222e9cc3..7da81462 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueCounter.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueCounter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetrics.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetrics.java
index 56368e73..d4389925 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetrics.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetrics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -41,10 +41,13 @@ public class RqueueMetrics implements RqueueMetricsRegistry {
private static final String PROCESSING_QUEUE_SIZE = "processing.queue.size";
private static final String DEAD_LETTER_QUEUE_SIZE = "dead.letter.queue.size";
private final QueueCounter queueCounter;
+
@Autowired
private MetricsProperties metricsProperties;
+
@Autowired
private MeterRegistry meterRegistry;
+
@Autowired
private RqueueStringDao rqueueStringDao;
@@ -67,24 +70,33 @@ private long size(String name, boolean isZset) {
private void monitor() {
for (QueueDetail queueDetail : EndpointRegistry.getActiveQueueDetails()) {
- Tags queueTags = Tags.concat(metricsProperties.getMetricTags(), "queue",
- queueDetail.getName());
- Gauge.builder(metricsProperties.getMetricName(QUEUE_SIZE), queueDetail,
+ Tags queueTags =
+ Tags.concat(metricsProperties.getMetricTags(), "queue", queueDetail.getName());
+ Gauge.builder(
+ metricsProperties.getMetricName(QUEUE_SIZE),
+ queueDetail,
c -> size(queueDetail.getQueueName(), false))
.tags(queueTags.and(QUEUE_KEY, queueDetail.getQueueName()))
- .description("The number of entries in this queue").register(meterRegistry);
- Gauge.builder(metricsProperties.getMetricName(PROCESSING_QUEUE_SIZE), queueDetail,
+ .description("The number of entries in this queue")
+ .register(meterRegistry);
+ Gauge.builder(
+ metricsProperties.getMetricName(PROCESSING_QUEUE_SIZE),
+ queueDetail,
c -> size(queueDetail.getProcessingQueueName(), true))
.tags(queueTags.and(QUEUE_KEY, queueDetail.getProcessingQueueName()))
- .description("The number of entries in the processing queue").register(meterRegistry);
- Gauge.builder(metricsProperties.getMetricName(SCHEDULED_QUEUE_SIZE), queueDetail,
+ .description("The number of entries in the processing queue")
+ .register(meterRegistry);
+ Gauge.builder(
+ metricsProperties.getMetricName(SCHEDULED_QUEUE_SIZE),
+ queueDetail,
c -> size(queueDetail.getScheduledQueueName(), true))
.tags(queueTags.and(QUEUE_KEY, queueDetail.getScheduledQueueName()))
.description("The number of entries waiting in the scheduled queue")
.register(meterRegistry);
if (queueDetail.isDlqSet()) {
Builder builder = Gauge.builder(
- metricsProperties.getMetricName(DEAD_LETTER_QUEUE_SIZE), queueDetail,
+ metricsProperties.getMetricName(DEAD_LETTER_QUEUE_SIZE),
+ queueDetail,
c -> size(queueDetail.getDeadLetterQueueName(), false));
builder.tags(queueTags);
builder.description("The number of entries in the dead letter queue");
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetricsCounter.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetricsCounter.java
index 6f2a5f23..119625ff 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetricsCounter.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetricsCounter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetricsRegistry.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetricsRegistry.java
index bd5fc685..9d51411d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetricsRegistry.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueMetricsRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueQueueMetrics.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueQueueMetrics.java
index 9ca9b5cb..982c2bce 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueQueueMetrics.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/metrics/RqueueQueueMetrics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/Concurrency.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/Concurrency.java
index a6db28b8..cc4e23d6 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/Concurrency.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/Concurrency.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/MessageMoveResult.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/MessageMoveResult.java
index 7a22668c..1c8d94b5 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/MessageMoveResult.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/MessageMoveResult.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/MinMax.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/MinMax.java
index ff761e72..5913a7cb 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/MinMax.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/MinMax.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/Pair.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/Pair.java
index 657e8a02..5bf1c32a 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/Pair.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/Pair.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/PubSubMessage.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/PubSubMessage.java
index e3d41447..ac28fe32 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/PubSubMessage.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/PubSubMessage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/SerializableBase.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/SerializableBase.java
index 0146d493..4312ba9c 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/SerializableBase.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/SerializableBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -27,6 +27,4 @@
@NoArgsConstructor
@EqualsAndHashCode
@JsonInclude(Include.NON_NULL)
-public abstract class SerializableBase implements Serializable {
-
-}
+public abstract class SerializableBase implements Serializable {}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/aggregator/QueueEvents.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/aggregator/QueueEvents.java
index 6faefb29..e0af1518 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/aggregator/QueueEvents.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/aggregator/QueueEvents.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/aggregator/TasksStat.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/aggregator/TasksStat.java
index 207b5d9d..646c7188 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/aggregator/TasksStat.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/aggregator/TasksStat.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/CheckinMessage.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/CheckinMessage.java
index f79ff6e4..8baecf05 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/CheckinMessage.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/CheckinMessage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/DeadLetterQueue.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/DeadLetterQueue.java
index b600c2d1..900159e1 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/DeadLetterQueue.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/DeadLetterQueue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/Execution.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/Execution.java
index 0e9e88fa..8b8465a2 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/Execution.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/Execution.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -38,7 +38,9 @@ public class Execution extends SerializableBase {
private long startTime;
private long endTime;
private String error;
+
@JsonIgnore
private Throwable exception;
+
private ExecutionStatus status;
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/JobRunTime.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/JobRunTime.java
index e7efb4c9..eb754600 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/JobRunTime.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/JobRunTime.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/MessageMetadata.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/MessageMetadata.java
index 615ed725..776fdcca 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/MessageMetadata.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/MessageMetadata.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -66,8 +66,8 @@ public void merge(MessageMetadata other) {
}
if (other.isDeleted() && !this.isDeleted()) {
this.deleted = true;
- if (MessageStatus.DELETED.equals(other.getStatus()) && !MessageStatus.DELETED.equals(
- this.getStatus())) {
+ if (MessageStatus.DELETED.equals(other.getStatus())
+ && !MessageStatus.DELETED.equals(this.getStatus())) {
this.status = MessageStatus.DELETED;
if (this.updatedOn < other.updatedOn) {
this.updatedOn = other.updatedOn;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/QueueConfig.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/QueueConfig.java
index 402d9e91..d0f6377a 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/QueueConfig.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/QueueConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/QueueStatistics.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/QueueStatistics.java
index 1eb9981d..e2007990 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/QueueStatistics.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/QueueStatistics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -35,8 +35,10 @@
public class QueueStatistics extends SerializableBase {
private static final long serialVersionUID = -4931206278693499365L;
+
@EqualsAndHashCode.Include
private String id;
+
private Long startEpochDate;
private Map tasksMovedToDeadLetter;
private Map tasksDiscarded;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/RqueueJob.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/RqueueJob.java
index 9e0460b0..0bddb208 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/RqueueJob.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/db/RqueueJob.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ActionType.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ActionType.java
index 35bb18f5..265a3ca1 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ActionType.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ActionType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/AggregationType.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/AggregationType.java
index d810a45e..de85292e 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/AggregationType.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/AggregationType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ChartDataType.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ChartDataType.java
index 52fff231..5cfe615d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ChartDataType.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ChartDataType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ChartType.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ChartType.java
index 25fbd741..1c37a6df 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ChartType.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/ChartType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/DataType.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/DataType.java
index c42005cc..31aee3fe 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/DataType.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/DataType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
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 bb9f5ef6..89e92793 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/JobStatus.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/JobStatus.java
index d55ea1c7..9e1532ad 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/JobStatus.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/JobStatus.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/MessageStatus.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/MessageStatus.java
index 6049a964..c493a78e 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/MessageStatus.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/MessageStatus.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/NavTab.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/NavTab.java
index 6881660c..d8ba4d43 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/NavTab.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/NavTab.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/PriorityMode.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/PriorityMode.java
index 0fa83405..f9215bcc 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/PriorityMode.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/PriorityMode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/PubSubType.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/PubSubType.java
index 41262f6c..23629f87 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/PubSubType.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/PubSubType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/RqueueMode.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/RqueueMode.java
index 3f84c134..7ed03ff0 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/RqueueMode.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/RqueueMode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/TableColumnType.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/TableColumnType.java
index 46fa3d2d..269ff015 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/TableColumnType.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/enums/TableColumnType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueBootstrapEvent.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueBootstrapEvent.java
index edcf633a..4b8658ee 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueBootstrapEvent.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueBootstrapEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueExecutionEvent.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueExecutionEvent.java
index 6831b148..e8f04f4b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueExecutionEvent.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueExecutionEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueuePubSubEvent.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueuePubSubEvent.java
index 0883478b..ab9749e1 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueuePubSubEvent.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueuePubSubEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueQueuePauseEvent.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueQueuePauseEvent.java
index 94ce2739..5013d452 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueQueuePauseEvent.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/event/RqueueQueuePauseEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/ChartDataRequest.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/ChartDataRequest.java
index 1a595caa..0d884b39 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/ChartDataRequest.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/ChartDataRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DataDeleteRequest.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DataDeleteRequest.java
index bdb1b5df..3f529584 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DataDeleteRequest.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DataDeleteRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DataTypeRequest.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DataTypeRequest.java
index 05d11d2f..0dac5589 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DataTypeRequest.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DataTypeRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DateViewRequest.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DateViewRequest.java
index 1e928a87..3c2b0262 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DateViewRequest.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/DateViewRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/MessageDeleteRequest.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/MessageDeleteRequest.java
index 0c316817..831ebd8e 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/MessageDeleteRequest.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/MessageDeleteRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/MessageMoveRequest.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/MessageMoveRequest.java
index 251da38f..e1d589f3 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/MessageMoveRequest.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/MessageMoveRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/PauseUnpauseQueueRequest.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/PauseUnpauseQueueRequest.java
index 75f40484..a555eaa4 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/PauseUnpauseQueueRequest.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/PauseUnpauseQueueRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/QueueExploreRequest.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/QueueExploreRequest.java
index a7c3fa0a..76350e28 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/QueueExploreRequest.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/request/QueueExploreRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/Action.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/Action.java
index 5d015a31..87594be9 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/Action.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/Action.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/BaseResponse.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/BaseResponse.java
index 04522334..44f40f49 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/BaseResponse.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/BaseResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/BooleanResponse.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/BooleanResponse.java
index 31bfe2fe..c0443dfb 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/BooleanResponse.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/BooleanResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/ChartDataResponse.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/ChartDataResponse.java
index 4329324f..223f330e 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/ChartDataResponse.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/ChartDataResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/DataSelectorResponse.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/DataSelectorResponse.java
index b5896ccd..6eee2fdf 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/DataSelectorResponse.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/DataSelectorResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/DataViewResponse.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/DataViewResponse.java
index 29b40f6b..c642ea17 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/DataViewResponse.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/DataViewResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/MessageMoveResponse.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/MessageMoveResponse.java
index ae8cf9b8..a936621b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/MessageMoveResponse.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/MessageMoveResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RedisDataDetail.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RedisDataDetail.java
index c7a4ae98..fbe40d51 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RedisDataDetail.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RedisDataDetail.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RowColumnMeta.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RowColumnMeta.java
index bc3d9707..2916c3cf 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RowColumnMeta.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RowColumnMeta.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RowColumnMetaType.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RowColumnMetaType.java
index a2d33ba9..39dc3d7d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RowColumnMetaType.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/RowColumnMetaType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/StringResponse.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/StringResponse.java
index 141fcb84..6ef70a7a 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/StringResponse.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/StringResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/Table.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/Table.java
index fb0c44a3..b869f9fe 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/Table.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/Table.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/TableColumn.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/TableColumn.java
index 5c3c8586..335c5270 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/TableColumn.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/TableColumn.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/TableRow.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/TableRow.java
index a50a243c..faecf039 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/TableRow.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/models/response/TableRow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/Constants.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/Constants.java
index 05d42b51..1a8ececb 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/Constants.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/Constants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2025 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -56,8 +56,7 @@ public final class Constants {
public static final String QUEUE_CRUD_LOCK_KEY_PREFIX = "q-crud::";
public static final String MESSAGE_LOCK_KEY_PREFIX = "msg::";
- private Constants() {
- }
+ private Constants() {}
public static String getQueueCrudLockKey(RqueueConfig rqueueConfig, String queueName) {
return rqueueConfig.getLockKey(QUEUE_CRUD_LOCK_KEY_PREFIX + queueName);
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/DateTimeUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/DateTimeUtils.java
index e0697549..ad886809 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/DateTimeUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/DateTimeUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -28,10 +28,10 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class DateTimeUtils {
- private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(
- "yyyy-MM-dd HH:mm");
- private static final DateTimeFormatter dateTimeFormatterWithSecond = DateTimeFormatter.ofPattern(
- "yyyy-MM-dd HH:mm:ss");
+ private static final DateTimeFormatter dateTimeFormatter =
+ DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
+ private static final DateTimeFormatter dateTimeFormatterWithSecond =
+ DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
private static String hourString(long hour) {
if (hour > 1) {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ExceptionUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ExceptionUtils.java
index 9577e2ea..8e009211 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ExceptionUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ExceptionUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -21,8 +21,7 @@
public final class ExceptionUtils {
- private ExceptionUtils() {
- }
+ private ExceptionUtils() {}
public static String getTraceback(Throwable e, int maxLength) {
if (e == null) {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/HttpUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/HttpUtils.java
index 51218850..c5f74bd0 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/HttpUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/HttpUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -26,8 +26,7 @@
@Slf4j
public final class HttpUtils {
- private HttpUtils() {
- }
+ private HttpUtils() {}
private static SimpleClientHttpRequestFactory getRequestFactory(RqueueConfig rqueueConfig) {
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
@@ -36,10 +35,9 @@ private static SimpleClientHttpRequestFactory getRequestFactory(RqueueConfig rqu
if (StringUtils.isEmpty(rqueueConfig.getProxyHost())) {
return requestFactory;
}
- Proxy proxy =
- new Proxy(
- rqueueConfig.getProxyType(),
- new InetSocketAddress(rqueueConfig.getProxyHost(), rqueueConfig.getProxyPort()));
+ Proxy proxy = new Proxy(
+ rqueueConfig.getProxyType(),
+ new InetSocketAddress(rqueueConfig.getProxyHost(), rqueueConfig.getProxyPort()));
requestFactory.setProxy(proxy);
return requestFactory;
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/PrefixLogger.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/PrefixLogger.java
index 62135ee3..735b1e92 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/PrefixLogger.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/PrefixLogger.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/PriorityUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/PriorityUtils.java
index 593396c0..98d9e940 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/PriorityUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/PriorityUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -22,8 +22,7 @@
public final class PriorityUtils {
- private PriorityUtils() {
- }
+ private PriorityUtils() {}
public static Set getNamesFromPriority(String queueName, Map priority) {
Set keys = new HashSet<>();
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/QueueThreadPool.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/QueueThreadPool.java
index 6df74328..f62f1468 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/QueueThreadPool.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/QueueThreadPool.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/RedisUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/RedisUtils.java
index 5c847b18..9284b798 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/RedisUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/RedisUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -34,40 +34,37 @@
public final class RedisUtils {
@SuppressWarnings({"java:S1104", "java:S1444"})
- public static RedisTemplateProvider redisTemplateProvider =
- new RedisTemplateProvider() {
- @Override
- public RedisTemplate getRedisTemplate(
- RedisConnectionFactory redisConnectionFactory) {
- RedisTemplate redisTemplate = new RedisTemplate<>();
- StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
- RqueueRedisSerializer rqueueRedisSerializer = new RqueueRedisSerializer();
- redisTemplate.setConnectionFactory(redisConnectionFactory);
- redisTemplate.setKeySerializer(stringRedisSerializer);
- redisTemplate.setValueSerializer(rqueueRedisSerializer);
- redisTemplate.setHashKeySerializer(stringRedisSerializer);
- redisTemplate.setHashValueSerializer(rqueueRedisSerializer);
- return redisTemplate;
- }
- };
+ public static RedisTemplateProvider redisTemplateProvider = new RedisTemplateProvider() {
+ @Override
+ public RedisTemplate getRedisTemplate(
+ RedisConnectionFactory redisConnectionFactory) {
+ RedisTemplate redisTemplate = new RedisTemplate<>();
+ StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+ RqueueRedisSerializer rqueueRedisSerializer = new RqueueRedisSerializer();
+ redisTemplate.setConnectionFactory(redisConnectionFactory);
+ redisTemplate.setKeySerializer(stringRedisSerializer);
+ redisTemplate.setValueSerializer(rqueueRedisSerializer);
+ redisTemplate.setHashKeySerializer(stringRedisSerializer);
+ redisTemplate.setHashValueSerializer(rqueueRedisSerializer);
+ return redisTemplate;
+ }
+ };
@SuppressWarnings({"java:S1104", "java:S1444"})
- public static RedisSerializationContextProvider redisSerializationContextProvider =
- () -> {
- StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
- RqueueRedisSerializer rqueueRedisSerializer = new RqueueRedisSerializer();
- RedisSerializationContextBuilder redisSerializationContextBuilder =
- RedisSerializationContext.newSerializationContext();
- redisSerializationContextBuilder =
- redisSerializationContextBuilder.key(stringRedisSerializer);
- redisSerializationContextBuilder =
- redisSerializationContextBuilder.value(rqueueRedisSerializer);
- redisSerializationContextBuilder =
- redisSerializationContextBuilder.hashKey(stringRedisSerializer);
- redisSerializationContextBuilder =
- redisSerializationContextBuilder.hashValue(rqueueRedisSerializer);
- return redisSerializationContextBuilder.build();
- };
+ public static RedisSerializationContextProvider redisSerializationContextProvider = () -> {
+ StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+ RqueueRedisSerializer rqueueRedisSerializer = new RqueueRedisSerializer();
+ RedisSerializationContextBuilder redisSerializationContextBuilder =
+ RedisSerializationContext.newSerializationContext();
+ redisSerializationContextBuilder = redisSerializationContextBuilder.key(stringRedisSerializer);
+ redisSerializationContextBuilder =
+ redisSerializationContextBuilder.value(rqueueRedisSerializer);
+ redisSerializationContextBuilder =
+ redisSerializationContextBuilder.hashKey(stringRedisSerializer);
+ redisSerializationContextBuilder =
+ redisSerializationContextBuilder.hashValue(rqueueRedisSerializer);
+ return redisSerializationContextBuilder.build();
+ };
@SuppressWarnings({"java:S1104", "java:S1444"})
public static ReactiveRedisTemplateProvider reactiveRedisTemplateProvider =
@@ -80,8 +77,7 @@ public ReactiveRedisTemplate getRedisTemplate(
}
};
- private RedisUtils() {
- }
+ private RedisUtils() {}
public static RedisTemplate getRedisTemplate(
RedisConnectionFactory redisConnectionFactory) {
@@ -96,16 +92,13 @@ public static ReactiveRedisTemplate getReactiveRedisTemplate(
@SuppressWarnings("unchecked")
public static List executePipeLine(
RedisTemplate template, RedisPipelineCallback callback) {
- return template.executePipelined(
- (RedisCallback)
- connection -> {
- RedisSerializer keySerializer =
- (RedisSerializer) template.getKeySerializer();
- RedisSerializer valueSerializer =
- (RedisSerializer) template.getValueSerializer();
- callback.doInRedis(connection, keySerializer, valueSerializer);
- return null;
- });
+ return template.executePipelined((RedisCallback) connection -> {
+ RedisSerializer keySerializer = (RedisSerializer) template.getKeySerializer();
+ RedisSerializer valueSerializer =
+ (RedisSerializer) template.getValueSerializer();
+ callback.doInRedis(connection, keySerializer, valueSerializer);
+ return null;
+ });
}
public static void setVersion(
@@ -131,12 +124,10 @@ public static int updateAndGetVersion(
if (dbVersion > 0) {
return dbVersion;
}
- List result =
- RedisUtils.executePipeLine(
- rqueueRedisTemplate.getRedisTemplate(),
- ((connection, keySerializer, valueSerializer) ->
- connection.eval(
- "return #redis.pcall('keys', 'rqueue-*')".getBytes(), ReturnType.INTEGER, 0)));
+ List result = RedisUtils.executePipeLine(
+ rqueueRedisTemplate.getRedisTemplate(),
+ ((connection, keySerializer, valueSerializer) -> connection.eval(
+ "return #redis.pcall('keys', 'rqueue-*')".getBytes(), ReturnType.INTEGER, 0)));
Long count = (Long) result.get(0);
if (count != null && count > 0L) {
rqueueRedisTemplate.set(versionKey, 1);
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/RetryableRunnable.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/RetryableRunnable.java
index bc6ada08..8ca430e5 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/RetryableRunnable.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/RetryableRunnable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/SerializationUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/SerializationUtils.java
index e1c3ba1c..30ed3fb1 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/SerializationUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/SerializationUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
package com.github.sonus21.rqueue.utils;
-
import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
@@ -25,8 +24,7 @@ public final class SerializationUtils {
public static final byte[] EMPTY_ARRAY = new byte[0];
- private SerializationUtils() {
- }
+ private SerializationUtils() {}
public static boolean isEmpty(byte[] bytes) {
return bytes == null || bytes.length == 0;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/StackTraceUtil.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/StackTraceUtil.java
index 8c180604..a05dd887 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/StackTraceUtil.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/StackTraceUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022-2023 Sonu Kumar
+ * Copyright (c) 2022-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -31,17 +31,16 @@ public void printStackTrace(int frameCount) {
for (int i = 2; printed < frameCount && i < elements.length; i++) {
StackTraceElement element = elements[i];
String className = element.getClassName();
- if (className.startsWith("org.springframework.aop") ||
- className.startsWith("org.springframework.cglib.proxy")) {
+ if (className.startsWith("org.springframework.aop")
+ || className.startsWith("org.springframework.cglib.proxy")) {
continue;
}
if (element.getMethodName().startsWith("invoke")) {
continue;
}
- log.info("{} {} {}", element.getClassName(), element.getMethodName(),
- element.getLineNumber());
+ log.info(
+ "{} {} {}", element.getClassName(), element.getMethodName(), element.getLineNumber());
printed += 1;
}
}
-
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/StringUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/StringUtils.java
index a83a9c9f..f136a316 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/StringUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/StringUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -20,8 +20,7 @@
public final class StringUtils {
- StringUtils() {
- }
+ StringUtils() {}
public static boolean isEmpty(String string) {
if (string == null) {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ThreadUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ThreadUtils.java
index 45cff706..8d04d791 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ThreadUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ThreadUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -31,8 +31,7 @@
public final class ThreadUtils {
- private ThreadUtils() {
- }
+ private ThreadUtils() {}
public static ThreadPoolTaskScheduler createTaskScheduler(
int poolSize, String threadPrefix, int terminationTime) {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/TimeoutUtils.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/TimeoutUtils.java
index 6c0f303d..bed940c5 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/TimeoutUtils.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/TimeoutUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -33,14 +33,12 @@ public final class TimeoutUtils {
public static final long EXECUTION_TIME = 10_000L;
public static final long SLEEP_TIME = 100L;
- private TimeoutUtils() {
- }
+ private TimeoutUtils() {}
public static void waitFor(
BooleanSupplier callback, long waitTimeInMilliSeconds, String description)
throws TimedOutException {
- waitFor(callback, waitTimeInMilliSeconds, SLEEP_TIME, description, () -> {
- });
+ waitFor(callback, waitTimeInMilliSeconds, SLEEP_TIME, description, () -> {});
}
public static void waitFor(BooleanSupplier callback, String description)
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/Validator.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/Validator.java
index 2cffd2ce..d6c68f63 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/Validator.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/Validator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -20,8 +20,7 @@
public final class Validator {
- private Validator() {
- }
+ private Validator() {}
public static void validateMessage(Object message) {
notNull(message, "message cannot be null");
@@ -60,10 +59,9 @@ public static void validatePriority(String priority) {
public static void validatePeriod(long period) {
if (period < Constants.MINIMUM_JOB_PERIOD) {
- throw new IllegalArgumentException(
- "period must be greater than or equal to "
- + Constants.MINIMUM_JOB_PERIOD
- + " Milliseconds");
+ throw new IllegalArgumentException("period must be greater than or equal to "
+ + Constants.MINIMUM_JOB_PERIOD
+ + " Milliseconds");
}
}
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ValueResolver.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ValueResolver.java
index 75d3baaf..07a0321b 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ValueResolver.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/ValueResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -30,8 +30,7 @@
public final class ValueResolver {
- private ValueResolver() {
- }
+ private ValueResolver() {}
@SuppressWarnings("unchecked")
public static T parseStringUsingSpel(String val, Class> t) {
@@ -91,9 +90,8 @@ private static Object resolveExpression(ApplicationContext applicationContext, S
if (exprResolver == null) {
return name;
}
- Object result =
- exprResolver.evaluate(
- placeholdersResolved, new BeanExpressionContext(configurableBeanFactory, null));
+ Object result = exprResolver.evaluate(
+ placeholdersResolved, new BeanExpressionContext(configurableBeanFactory, null));
if (result != null) {
return result;
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/ExponentialTaskExecutionBackOff.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/ExponentialTaskExecutionBackOff.java
index fd4b6f64..85c85042 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/ExponentialTaskExecutionBackOff.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/ExponentialTaskExecutionBackOff.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -60,8 +60,7 @@ public class ExponentialTaskExecutionBackOff implements TaskExecutionBackOff {
* interval of {@value #DEFAULT_MAX_INTERVAL}, multiplier of {@value #DEFAULT_MULTIPLIER} and
* default unlimited retries.
*/
- public ExponentialTaskExecutionBackOff() {
- }
+ public ExponentialTaskExecutionBackOff() {}
/**
* Create an instance.
@@ -104,11 +103,10 @@ private void checkMaxInterval(long initialInterval, long maxInterval) {
private void checkMultiplier(double multiplier) {
if (multiplier < 1) {
- throw new IllegalArgumentException(
- "Invalid multiplier '"
- + multiplier
- + "'. Should be greater than "
- + "or equal to 1. A multiplier of 1 is equivalent to a fixed interval.");
+ throw new IllegalArgumentException("Invalid multiplier '"
+ + multiplier
+ + "'. Should be greater than "
+ + "or equal to 1. A multiplier of 1 is equivalent to a fixed interval.");
}
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/FixedTaskExecutionBackOff.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/FixedTaskExecutionBackOff.java
index 3be00035..8823e5c7 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/FixedTaskExecutionBackOff.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/backoff/FixedTaskExecutionBackOff.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -43,8 +43,7 @@ public class FixedTaskExecutionBackOff implements TaskExecutionBackOff {
* Create an instance with an interval of {@value #DEFAULT_INTERVAL} ms and maximum value of
* retries.
*/
- public FixedTaskExecutionBackOff() {
- }
+ public FixedTaskExecutionBackOff() {}
/**
* Create an instance.
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 8b76de3f..1ba6616c 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2024 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -47,8 +47,8 @@ public interface TaskExecutionBackOff {
* @param throwable the exception that has occurred
* @return backoff in the millisecond.
*/
- default long nextBackOff(Object message, RqueueMessage rqueueMessage, int failureCount,
- Throwable throwable) {
+ default long nextBackOff(
+ Object message, RqueueMessage rqueueMessage, int failureCount, Throwable throwable) {
return nextBackOff(message, rqueueMessage, failureCount);
}
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/ReactiveDisabled.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/ReactiveDisabled.java
index 244966f0..7d083d7c 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/ReactiveDisabled.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/ReactiveDisabled.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/ReactiveEnabled.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/ReactiveEnabled.java
index 47dcdc2d..345669db 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/ReactiveEnabled.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/ReactiveEnabled.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/RqueueEnabled.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/RqueueEnabled.java
index 2374a061..c64c9183 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/RqueueEnabled.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/condition/RqueueEnabled.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022-2023 Sonu Kumar
+ * Copyright (c) 2022-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DateTimeFunction.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DateTimeFunction.java
index a9cbd196..86fda201 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DateTimeFunction.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DateTimeFunction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DeadLetterQueuesFunction.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DeadLetterQueuesFunction.java
index 732dc08c..55dd0a25 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DeadLetterQueuesFunction.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DeadLetterQueuesFunction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DefaultFunction.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DefaultFunction.java
index 443cd7c7..3de0d86c 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DefaultFunction.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/DefaultFunction.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/ResourceLoader.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/ResourceLoader.java
index 00436ae7..d0fc8b27 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/ResourceLoader.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/ResourceLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/RqueuePebbleExtension.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/RqueuePebbleExtension.java
index 23d48e1f..2401aa7d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/RqueuePebbleExtension.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/pebble/RqueuePebbleExtension.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/BaseController.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/BaseController.java
index 192f77ee..9ceeebef 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/BaseController.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/BaseController.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/BaseReactiveController.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/BaseReactiveController.java
index a0d9fff9..e60e9b40 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/BaseReactiveController.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/BaseReactiveController.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/ReactiveRqueueRestController.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/ReactiveRqueueRestController.java
index 7396653f..68f69110 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/ReactiveRqueueRestController.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/ReactiveRqueueRestController.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/ReactiveRqueueViewController.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/ReactiveRqueueViewController.java
index 561702c2..70c5d99a 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/ReactiveRqueueViewController.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/ReactiveRqueueViewController.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/RqueueRestController.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/RqueueRestController.java
index 1778df42..dc084251 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/RqueueRestController.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/RqueueRestController.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/RqueueViewController.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/RqueueViewController.java
index d25d6953..de4e43a3 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/RqueueViewController.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/controller/RqueueViewController.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueDashboardChartService.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueDashboardChartService.java
index 0d7561cd..c1632cd7 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueDashboardChartService.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueDashboardChartService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobMetricsAggregatorService.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobMetricsAggregatorService.java
index 644d8206..3d0a14f9 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobMetricsAggregatorService.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobMetricsAggregatorService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobService.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobService.java
index 6b645a00..43990cc9 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobService.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueMessageMetadataService.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueMessageMetadataService.java
index 1dd29585..e4921f5a 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueMessageMetadataService.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueMessageMetadataService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2025 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueQDetailService.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueQDetailService.java
index b9cfa915..39e11540 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueQDetailService.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueQDetailService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueSystemManagerService.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueSystemManagerService.java
index a0523bef..dac69960 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueSystemManagerService.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueSystemManagerService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueUtilityService.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueUtilityService.java
index bed99a84..f5bc62e3 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueUtilityService.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueUtilityService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueViewControllerService.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueViewControllerService.java
index 44020371..3cae1594 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueViewControllerService.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueViewControllerService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueDashboardChartServiceImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueDashboardChartServiceImpl.java
index 6af94829..678275bb 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueDashboardChartServiceImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueDashboardChartServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -262,10 +262,9 @@ private List createRow(
private List> createChartData(
String title, List chartDataTypeList, Map idToTasksStat) {
- List> entries =
- idToTasksStat.entrySet().stream()
- .sorted((o1, o2) -> o2.getKey() - o1.getKey())
- .collect(Collectors.toList());
+ List> entries = idToTasksStat.entrySet().stream()
+ .sorted((o1, o2) -> o2.getKey() - o1.getKey())
+ .collect(Collectors.toList());
List> rows = new ArrayList<>();
rows.add(getHeader(title, chartDataTypeList));
for (Entry entry : entries) {
@@ -278,13 +277,12 @@ private List> aggregateMonthly(
int numberOfDays,
List queueStatisticsList,
List chartDataTypeList) {
- Map monthToChartDataType =
- aggregateData(
- (date, today) ->
- (int) Math.floor((today.toEpochDay() - LocalDate.parse(date).toEpochDay()) / 30.0f),
- queueStatisticsList,
- chartDataTypeList,
- getCount(numberOfDays, Constants.DAYS_IN_A_MONTH));
+ Map monthToChartDataType = aggregateData(
+ (date, today) ->
+ (int) Math.floor((today.toEpochDay() - LocalDate.parse(date).toEpochDay()) / 30.0f),
+ queueStatisticsList,
+ chartDataTypeList,
+ getCount(numberOfDays, Constants.DAYS_IN_A_MONTH));
return createChartData("Monthly", chartDataTypeList, monthToChartDataType);
}
@@ -292,12 +290,11 @@ private List> aggregateDaily(
int numberOfDays,
List queueStatisticsList,
List chartDataTypes) {
- Map dayToChartDataType =
- aggregateData(
- (date, today) -> (int) (today.toEpochDay() - LocalDate.parse(date).toEpochDay()),
- queueStatisticsList,
- chartDataTypes,
- getCount(numberOfDays, 1));
+ Map dayToChartDataType = aggregateData(
+ (date, today) -> (int) (today.toEpochDay() - LocalDate.parse(date).toEpochDay()),
+ queueStatisticsList,
+ chartDataTypes,
+ getCount(numberOfDays, 1));
return createChartData("Daily", chartDataTypes, dayToChartDataType);
}
@@ -312,13 +309,12 @@ private List> aggregateWeekly(
int numberOfDays,
List queueStatisticsList,
List chartDataTypeList) {
- Map weekToChartDataType =
- aggregateData(
- (date, today) ->
- (int) Math.floor((today.toEpochDay() - LocalDate.parse(date).toEpochDay()) / 7.0f),
- queueStatisticsList,
- chartDataTypeList,
- getCount(numberOfDays, Constants.DAYS_IN_A_WEEK));
+ Map weekToChartDataType = aggregateData(
+ (date, today) ->
+ (int) Math.floor((today.toEpochDay() - LocalDate.parse(date).toEpochDay()) / 7.0f),
+ queueStatisticsList,
+ chartDataTypeList,
+ getCount(numberOfDays, Constants.DAYS_IN_A_WEEK));
return createChartData("Weekly", chartDataTypeList, weekToChartDataType);
}
@@ -345,12 +341,11 @@ private List> getChartData(
private ChartDataResponse getQueueStats(ChartDataRequest chartDataRequest) {
Collection ids = getQueueStatsId(chartDataRequest);
- List> rows =
- getChartData(
- chartDataRequest.numberOfDays(rqueueWebConfig),
- ids,
- chartDataRequest.getAggregationType(),
- chartDataRequest.getDateTypes());
+ List> rows = getChartData(
+ chartDataRequest.numberOfDays(rqueueWebConfig),
+ ids,
+ chartDataRequest.getAggregationType(),
+ chartDataRequest.getDateTypes());
ChartDataResponse response = new ChartDataResponse();
response.setData(rows);
response.setHTitle(chartDataRequest.getAggregationType().getDescription());
@@ -378,12 +373,11 @@ private Collection getQueueStatsId(ChartDataRequest chartDataRequest) {
private ChartDataResponse getQueueLatency(ChartDataRequest chartDataRequest) {
Collection ids = getQueueStatsId(chartDataRequest);
- List> rows =
- getChartData(
- chartDataRequest.numberOfDays(rqueueWebConfig),
- ids,
- chartDataRequest.getAggregationType(),
- Collections.singletonList(ChartDataType.EXECUTION));
+ List> rows = getChartData(
+ chartDataRequest.numberOfDays(rqueueWebConfig),
+ ids,
+ chartDataRequest.getAggregationType(),
+ Collections.singletonList(ChartDataType.EXECUTION));
ChartDataResponse response = new ChartDataResponse();
response.setData(rows);
response.setHTitle(chartDataRequest.getAggregationType().getDescription());
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueJobServiceImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueJobServiceImpl.java
index 7fc8b24f..a1827e2f 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueJobServiceImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueJobServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -53,12 +53,10 @@ public RqueueJobServiceImpl(RqueueJobDao rqueueJobDao) {
private TableRow getTableRow(RqueueJob job) throws ProcessingException {
List columns = new LinkedList<>();
columns.add(new TableColumn(job.getId()));
- columns.add(
- new TableColumn(
- String.format(
- "%s/%s",
- DateTimeUtils.formatMilliToString(job.getCreatedAt()),
- DateTimeUtils.formatMilliToString(job.getUpdatedAt()))));
+ columns.add(new TableColumn(String.format(
+ "%s/%s",
+ DateTimeUtils.formatMilliToString(job.getCreatedAt()),
+ DateTimeUtils.formatMilliToString(job.getUpdatedAt()))));
if (job.getLastCheckinAt() == 0) {
columns.add(new TableColumn(""));
} else {
@@ -94,17 +92,16 @@ public DataViewResponse getJobs(String messageId) throws ProcessingException {
response.setCode(0);
response.setMessage("No jobs found");
} else {
- jobList.sort(
- (o1, o2) -> {
- long diff = o1.getUpdatedAt() - o2.getUpdatedAt();
- if (diff == 0) {
- return 0;
- }
- if (diff > 0) {
- return 1;
- }
- return -1;
- });
+ jobList.sort((o1, o2) -> {
+ long diff = o1.getUpdatedAt() - o2.getUpdatedAt();
+ if (diff == 0) {
+ return 0;
+ }
+ if (diff > 0) {
+ return 1;
+ }
+ return -1;
+ });
response.setHeaders(
Arrays.asList("Id", "StartTime/EndTime", "Last Checkin", "Error", "Status", "CheckIns"));
for (RqueueJob job : jobList) {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueMessageMetadataServiceImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueMessageMetadataServiceImpl.java
index a84d437d..c86243c6 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueMessageMetadataServiceImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueMessageMetadataServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2025 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -145,20 +145,17 @@ public List> readMessageMetadataForQueue(
metaIds.stream().collect(Collectors.toMap(TypedTuple::getValue, TypedTuple::getScore));
List messageMetadata = findAll(metaIdToScoreMap.keySet());
return messageMetadata.stream()
- .map(
- metadata -> {
- Double score = metaIdToScoreMap.get(metadata.getId());
- if (score == null) {
- return null;
- } else {
- return new DefaultTypedTuple<>(metadata, score);
- }
- })
+ .map(metadata -> {
+ Double score = metaIdToScoreMap.get(metadata.getId());
+ if (score == null) {
+ return null;
+ } else {
+ return new DefaultTypedTuple<>(metadata, score);
+ }
+ })
.filter(Objects::nonNull)
- .sorted(
- Comparator.comparingLong(
- (DefaultTypedTuple e1) ->
- -(Objects.requireNonNull(e1.getValue()).getUpdatedOn())))
+ .sorted(Comparator.comparingLong((DefaultTypedTuple e1) ->
+ -(Objects.requireNonNull(e1.getValue()).getUpdatedOn())))
.collect(Collectors.toList());
}
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueQDetailServiceImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueQDetailServiceImpl.java
index 38a3af56..2f925a01 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueQDetailServiceImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueQDetailServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2025 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -101,50 +101,43 @@ public List> getQueueDataStructureDetail(QueueCon
Long pending = stringRqueueRedisTemplate.getListSize(queueConfig.getQueueName());
String processingQueueName = queueConfig.getProcessingQueueName();
Long running = stringRqueueRedisTemplate.getZsetSize(processingQueueName);
- List> queueRedisDataDetails =
- newArrayList(
- new HashMap.SimpleEntry<>(
- NavTab.PENDING,
- new RedisDataDetail(
- queueConfig.getQueueName(), DataType.LIST, pending == null ? 0 : pending)),
- new HashMap.SimpleEntry<>(
- NavTab.RUNNING,
- new RedisDataDetail(
- processingQueueName, DataType.ZSET, running == null ? 0 : running)));
- String scheduledQueueName = queueConfig.getScheduledQueueName();
- Long scheduled = stringRqueueRedisTemplate.getZsetSize(scheduledQueueName);
- queueRedisDataDetails.add(
+ List> queueRedisDataDetails = newArrayList(
+ new HashMap.SimpleEntry<>(
+ NavTab.PENDING,
+ new RedisDataDetail(
+ queueConfig.getQueueName(), DataType.LIST, pending == null ? 0 : pending)),
new HashMap.SimpleEntry<>(
- NavTab.SCHEDULED,
+ NavTab.RUNNING,
new RedisDataDetail(
- scheduledQueueName, DataType.ZSET, scheduled == null ? 0 : scheduled)));
+ processingQueueName, DataType.ZSET, running == null ? 0 : running)));
+ String scheduledQueueName = queueConfig.getScheduledQueueName();
+ Long scheduled = stringRqueueRedisTemplate.getZsetSize(scheduledQueueName);
+ queueRedisDataDetails.add(new HashMap.SimpleEntry<>(
+ NavTab.SCHEDULED,
+ new RedisDataDetail(scheduledQueueName, DataType.ZSET, scheduled == null ? 0 : scheduled)));
if (!CollectionUtils.isEmpty(queueConfig.getDeadLetterQueues())) {
for (DeadLetterQueue dlq : queueConfig.getDeadLetterQueues()) {
if (!dlq.isConsumerEnabled()) {
Long dlqSize = stringRqueueRedisTemplate.getListSize(dlq.getName());
- queueRedisDataDetails.add(
- new HashMap.SimpleEntry<>(
- NavTab.DEAD,
- new RedisDataDetail(
- dlq.getName(), DataType.LIST, dlqSize == null ? 0 : dlqSize)));
+ queueRedisDataDetails.add(new HashMap.SimpleEntry<>(
+ NavTab.DEAD,
+ new RedisDataDetail(dlq.getName(), DataType.LIST, dlqSize == null ? 0 : dlqSize)));
} else {
// TODO should we redirect to the queue page?
- queueRedisDataDetails.add(
- new HashMap.SimpleEntry<>(
- NavTab.DEAD, new RedisDataDetail(dlq.getName(), DataType.LIST, -1)));
+ queueRedisDataDetails.add(new HashMap.SimpleEntry<>(
+ NavTab.DEAD, new RedisDataDetail(dlq.getName(), DataType.LIST, -1)));
}
}
}
if (rqueueConfig.messageInTerminalStateShouldBeStored()
&& !StringUtils.isEmpty(queueConfig.getCompletedQueueName())) {
Long completed = stringRqueueRedisTemplate.getZsetSize(queueConfig.getCompletedQueueName());
- queueRedisDataDetails.add(
- new HashMap.SimpleEntry<>(
- NavTab.COMPLETED,
- new RedisDataDetail(
- queueConfig.getCompletedQueueName(),
- DataType.ZSET,
- completed == null ? 0 : completed)));
+ queueRedisDataDetails.add(new HashMap.SimpleEntry<>(
+ NavTab.COMPLETED,
+ new RedisDataDetail(
+ queueConfig.getCompletedQueueName(),
+ DataType.ZSET,
+ completed == null ? 0 : completed)));
}
return queueRedisDataDetails;
}
@@ -210,12 +203,8 @@ private List buildRows(
msgIdToDeleted.put(id, messageMetadata.isDeleted());
}
return rqueueMessages.stream()
- .map(
- e ->
- rowBuilder.row(
- e.getValue(),
- msgIdToDeleted.getOrDefault(e.getValue().getId(), false),
- e.getScore()))
+ .map(e -> rowBuilder.row(
+ e.getValue(), msgIdToDeleted.getOrDefault(e.getValue().getId(), false), e.getScore()))
.collect(Collectors.toList());
}
@@ -256,25 +245,21 @@ public DataViewResponse getExplorePageData(
switch (type) {
case ZSET:
if (scheduledQueue) {
- response.setRows(
- buildRows(
- readFromZset(name, pageNumber, itemPerPage), new ZsetRowBuilder(true, false)));
+ response.setRows(buildRows(
+ readFromZset(name, pageNumber, itemPerPage), new ZsetRowBuilder(true, false)));
} else if (completionQueue) {
- response.setRows(
- buildRows(
- readFromMessageMetadataStore(name, pageNumber, itemPerPage),
- new ZsetRowBuilder(false, true)));
+ response.setRows(buildRows(
+ readFromMessageMetadataStore(name, pageNumber, itemPerPage),
+ new ZsetRowBuilder(false, true)));
} else {
- response.setRows(
- buildRows(
- readFromZetWithScore(name, pageNumber, itemPerPage),
- new ZsetRowBuilder(false, false)));
+ response.setRows(buildRows(
+ readFromZetWithScore(name, pageNumber, itemPerPage),
+ new ZsetRowBuilder(false, false)));
}
break;
case LIST:
- response.setRows(
- buildRows(
- readFromList(name, pageNumber, itemPerPage), new ListRowBuilder(deadLetterQueue)));
+ response.setRows(buildRows(
+ readFromList(name, pageNumber, itemPerPage), new ListRowBuilder(deadLetterQueue)));
break;
default:
throw new UnknownSwitchCase(type.name());
@@ -292,11 +277,9 @@ private List> readFromMessageMetadataStore(
return Collections.emptyList();
}
return mes.stream()
- .map(
- e ->
- new DefaultTypedTuple<>(
- Objects.requireNonNull(e.getValue()).getRqueueMessage(),
- (double) e.getValue().getUpdatedOn()))
+ .map(e -> new DefaultTypedTuple<>(
+ Objects.requireNonNull(e.getValue()).getRqueueMessage(),
+ (double) e.getValue().getUpdatedOn()))
.collect(Collectors.toList());
}
@@ -333,11 +316,8 @@ private DataViewResponse responseForZset(
} else {
response.setHeaders(Arrays.asList("Value", "Score"));
for (TypedTuple tuple : stringRqueueRedisTemplate.zrangeWithScore(name, start, end)) {
- tableRows.add(
- new TableRow(
- Arrays.asList(
- new TableColumn(String.valueOf(tuple.getValue())),
- new TableColumn(tuple.getScore()))));
+ tableRows.add(new TableRow(Arrays.asList(
+ new TableColumn(String.valueOf(tuple.getValue())), new TableColumn(tuple.getScore()))));
}
}
response.setRows(tableRows);
@@ -409,21 +389,19 @@ public List> getRunningTasks() {
List> rows = new ArrayList<>();
List result = new ArrayList<>();
if (!CollectionUtils.isEmpty(queueConfigs)) {
- result =
- RedisUtils.executePipeLine(
- stringRqueueRedisTemplate.getRedisTemplate(),
- ((connection, keySerializer, valueSerializer) -> {
- for (QueueConfig queueConfig : queueConfigs) {
- connection.zCard(keySerializer.serialize(queueConfig.getProcessingQueueName()));
- }
- }));
+ result = RedisUtils.executePipeLine(
+ stringRqueueRedisTemplate.getRedisTemplate(),
+ ((connection, keySerializer, valueSerializer) -> {
+ for (QueueConfig queueConfig : queueConfigs) {
+ connection.zCard(keySerializer.serialize(queueConfig.getProcessingQueueName()));
+ }
+ }));
}
rows.add(Arrays.asList("Queue", "Processing [ZSET]", "Number of Messages"));
for (int i = 0; i < queueConfigs.size(); i++) {
QueueConfig queueConfig = queueConfigs.get(i);
- rows.add(
- Arrays.asList(
- queueConfig.getName(), queueConfig.getProcessingQueueName(), result.get(i)));
+ rows.add(Arrays.asList(
+ queueConfig.getName(), queueConfig.getProcessingQueueName(), result.get(i)));
}
return rows;
}
@@ -434,14 +412,13 @@ public List> getWaitingTasks() {
List> rows = new ArrayList<>();
List result = new ArrayList<>();
if (!CollectionUtils.isEmpty(queueConfigs)) {
- result =
- RedisUtils.executePipeLine(
- stringRqueueRedisTemplate.getRedisTemplate(),
- ((connection, keySerializer, valueSerializer) -> {
- for (QueueConfig queueConfig : queueConfigs) {
- connection.lLen(keySerializer.serialize(queueConfig.getQueueName()));
- }
- }));
+ result = RedisUtils.executePipeLine(
+ stringRqueueRedisTemplate.getRedisTemplate(),
+ ((connection, keySerializer, valueSerializer) -> {
+ for (QueueConfig queueConfig : queueConfigs) {
+ connection.lLen(keySerializer.serialize(queueConfig.getQueueName()));
+ }
+ }));
}
rows.add(Arrays.asList("Queue", "Queue [LIST]", "Number of Messages"));
for (int i = 0; i < queueConfigs.size(); i++) {
@@ -457,14 +434,13 @@ public List> getScheduledTasks() {
List> rows = new ArrayList<>();
List result = new ArrayList<>();
if (!CollectionUtils.isEmpty(queueConfigs)) {
- result =
- RedisUtils.executePipeLine(
- stringRqueueRedisTemplate.getRedisTemplate(),
- ((connection, keySerializer, valueSerializer) -> {
- for (QueueConfig queueConfig : queueConfigs) {
- connection.zCard(keySerializer.serialize(queueConfig.getScheduledQueueName()));
- }
- }));
+ result = RedisUtils.executePipeLine(
+ stringRqueueRedisTemplate.getRedisTemplate(),
+ ((connection, keySerializer, valueSerializer) -> {
+ for (QueueConfig queueConfig : queueConfigs) {
+ connection.zCard(keySerializer.serialize(queueConfig.getScheduledQueueName()));
+ }
+ }));
}
rows.add(Arrays.asList("Queue", "Scheduled [ZSET]", "Number of Messages"));
for (int i = 0; i < queueConfigs.size(); i++) {
@@ -488,8 +464,8 @@ private void addRows(
String name = Constants.BLANK;
if (i == 0
|| !queueConfig
- .getQueueName()
- .equals(queueConfigAndDlq.get(i - 1).getKey().getQueueName())) {
+ .getQueueName()
+ .equals(queueConfigAndDlq.get(i - 1).getKey().getQueueName())) {
name = queueConfig.getName();
}
rows.add(Arrays.asList(name, entry.getValue(), result.get(j++)));
@@ -513,16 +489,15 @@ public List> getDeadLetterTasks() {
List> rows = new ArrayList<>();
List result = new ArrayList<>();
if (!CollectionUtils.isEmpty(queueConfigAndDlq)) {
- result =
- RedisUtils.executePipeLine(
- stringRqueueRedisTemplate.getRedisTemplate(),
- ((connection, keySerializer, valueSerializer) -> {
- for (Entry entry : queueConfigAndDlq) {
- if (!entry.getValue().isEmpty()) {
- connection.lLen(keySerializer.serialize(entry.getValue()));
- }
- }
- }));
+ result = RedisUtils.executePipeLine(
+ stringRqueueRedisTemplate.getRedisTemplate(),
+ ((connection, keySerializer, valueSerializer) -> {
+ for (Entry entry : queueConfigAndDlq) {
+ if (!entry.getValue().isEmpty()) {
+ connection.lLen(keySerializer.serialize(entry.getValue()));
+ }
+ }
+ }));
}
rows.add(Arrays.asList("Queue", "Dead Letter Queues [LIST]", "Number of Messages"));
addRows(result, rows, queueConfigAndDlq);
@@ -546,9 +521,8 @@ private interface RowBuilder {
default TableRow getRow(RqueueMessage rqueueMessage) {
TableRow row = new TableRow(new TableColumn(rqueueMessage.getId()));
TableColumn column = new TableColumn(rqueueMessage.toString());
- column.setMeta(
- Collections.singletonList(
- new RowColumnMeta(RowColumnMetaType.JOBS_BUTTON, rqueueMessage.getId())));
+ column.setMeta(Collections.singletonList(
+ new RowColumnMeta(RowColumnMetaType.JOBS_BUTTON, rqueueMessage.getId())));
row.addColumn(column);
if (rqueueMessage.isPeriodic()) {
row.addColumn(new TableColumn("Periodic(" + rqueueMessage.getPeriod() + ")Ms"));
@@ -602,19 +576,14 @@ private static class ZsetRowBuilder implements RowBuilder {
public TableRow row(RqueueMessage rqueueMessage, boolean deleted, Double score) {
TableRow row = getRow(rqueueMessage);
if (scheduledQueue) {
- row.addColumn(
- new TableColumn(
- DateTimeUtils.milliToHumanRepresentation(
- rqueueMessage.getProcessAt() - currentTime)));
+ row.addColumn(new TableColumn(
+ DateTimeUtils.milliToHumanRepresentation(rqueueMessage.getProcessAt() - currentTime)));
} else if (completionQueue) {
- row.addColumn(
- new TableColumn(
- DateTimeUtils.milliToHumanRepresentation(
- System.currentTimeMillis() - score.longValue())));
+ row.addColumn(new TableColumn(DateTimeUtils.milliToHumanRepresentation(
+ System.currentTimeMillis() - score.longValue())));
} else {
- row.addColumn(
- new TableColumn(
- DateTimeUtils.milliToHumanRepresentation(score.longValue() - currentTime)));
+ row.addColumn(new TableColumn(
+ DateTimeUtils.milliToHumanRepresentation(score.longValue() - currentTime)));
}
if (!completionQueue) {
if (!deleted) {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueSystemManagerServiceImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueSystemManagerServiceImpl.java
index 2ba706fe..3adabd4d 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueSystemManagerServiceImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueSystemManagerServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -70,11 +70,10 @@ public RqueueSystemManagerServiceImpl(
}
private List queueKeys(QueueConfig queueConfig) {
- List keys =
- newArrayList(
- queueConfig.getQueueName(),
- queueConfig.getProcessingQueueName(),
- rqueueConfig.getQueueStatisticsKey(queueConfig.getName()));
+ List keys = newArrayList(
+ queueConfig.getQueueName(),
+ queueConfig.getProcessingQueueName(),
+ rqueueConfig.getQueueStatisticsKey(queueConfig.getName()));
keys.add(queueConfig.getScheduledQueueName());
if (queueConfig.hasDeadLetterQueue()) {
for (DeadLetterQueue queue : queueConfig.getDeadLetterQueues()) {
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueUtilityServiceImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueUtilityServiceImpl.java
index bdfa1055..6ddf69a4 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueUtilityServiceImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueUtilityServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -95,9 +95,8 @@ public BooleanResponse deleteMessage(String queueName, String id) {
booleanResponse.setMessage("Queue config not found!");
return booleanResponse;
}
- booleanResponse.setValue(
- messageMetadataService.deleteMessage(
- queueName, id, Duration.ofDays(Constants.DAYS_IN_A_MONTH)));
+ booleanResponse.setValue(messageMetadataService.deleteMessage(
+ queueName, id, Duration.ofDays(Constants.DAYS_IN_A_MONTH)));
return booleanResponse;
}
@@ -117,9 +116,8 @@ private MessageMoveResponse moveMessageToZset(MessageMoveRequest messageMoveRequ
}
MessageMoveResult result;
if (messageMoveRequest.getSrcType() == DataType.ZSET) {
- result =
- rqueueMessageTemplate.moveMessageZsetToZset(
- src, dst, requestMessageCount, scoreInMilli, fixedScore);
+ result = rqueueMessageTemplate.moveMessageZsetToZset(
+ src, dst, requestMessageCount, scoreInMilli, fixedScore);
} else {
result =
rqueueMessageTemplate.moveMessageListToZset(src, dst, requestMessageCount, scoreInMilli);
@@ -173,12 +171,11 @@ public BooleanResponse makeEmpty(String queueName, String dataName) {
}
return new BooleanResponse(
MessageSweeper.getInstance(rqueueConfig, rqueueMessageTemplate, messageMetadataService)
- .deleteAllMessages(
- MessageDeleteRequest.builder()
- .dataName(dataName)
- .queueName(queueName)
- .dataType(type)
- .build()));
+ .deleteAllMessages(MessageDeleteRequest.builder()
+ .dataName(dataName)
+ .queueName(queueName)
+ .dataType(type)
+ .build()));
}
private boolean shouldFetchVersionDetail() {
@@ -258,7 +255,7 @@ public BaseResponse pauseUnpauseQueue(PauseUnpauseQueueRequest request) {
private List> getDailyDateCounter() {
List> dateSelector = new LinkedList<>();
- int[] dates = new int[]{1, 2, 3, 4, 6, 7};
+ int[] dates = new int[] {1, 2, 3, 4, 6, 7};
int step = 15;
int stepAfter = 15;
int i = 1;
diff --git a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueViewControllerServiceImpl.java b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueViewControllerServiceImpl.java
index 82b49b89..50bf146a 100644
--- a/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueViewControllerServiceImpl.java
+++ b/rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueViewControllerServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -95,8 +95,8 @@ public void queues(Model model, String xForwardedPrefix) {
addNavData(model, NavTab.QUEUES);
model.addAttribute("title", "Queues");
List queueConfigs = rqueueSystemManagerService.getSortedQueueConfigs();
- List>>> queueNameConfigs =
- new ArrayList<>(rqueueQDetailService.getQueueDataStructureDetails(queueConfigs).entrySet());
+ List>>> queueNameConfigs = new ArrayList<>(
+ rqueueQDetailService.getQueueDataStructureDetails(queueConfigs).entrySet());
queueNameConfigs.sort(Entry.comparingByKey());
model.addAttribute("queues", queueConfigs);
model.addAttribute("queueConfigs", queueNameConfigs);
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/CoreUnitTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/CoreUnitTest.java
index b6df1f23..62d7f161 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/CoreUnitTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/CoreUnitTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -25,13 +25,9 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
-
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Tag("unit")
@Tag("core")
@ExtendWith({MockitoExtension.class, TestTracerExtension.class})
-public @interface CoreUnitTest {
-
-
-}
+public @interface CoreUnitTest {}
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/common/RqueueLockManagerImplTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/common/RqueueLockManagerImplTest.java
index 08008747..cc55f12c 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/common/RqueueLockManagerImplTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/common/RqueueLockManagerImplTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -35,8 +35,10 @@ class RqueueLockManagerImplTest extends TestBase {
private final String lockKey = "test-key";
private final String lockValue = "test-value";
+
@Mock
private RqueueStringDao rqueueStringDao;
+
private RqueueLockManager rqueueLockManager;
@BeforeEach
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/RqueueConfigTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/RqueueConfigTest.java
index 231711f7..5c797a43 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/RqueueConfigTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/RqueueConfigTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/RqueueListenerBaseConfigTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/RqueueListenerBaseConfigTest.java
index 4376999e..f4a99042 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/RqueueListenerBaseConfigTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/RqueueListenerBaseConfigTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -42,12 +42,16 @@
class RqueueListenerBaseConfigTest extends TestBase {
private final String versionKey = "__rq::version";
+
@Mock
private RedisConnection redisConnection;
+
@Mock
private ConfigurableBeanFactory beanFactory;
+
@Mock
private RedisConnectionFactory redisConnectionFactory;
+
@Mock
private RqueueMessageTemplate rqueueMessageTemplate;
@@ -102,7 +106,9 @@ void rqueueConfigSetConnectionFactoryFromBeanFactoryExistingData() throws Illega
void rqueueConfigSetConnectionFactoryFromBeanFactoryWithDifferentValue()
throws IllegalAccessException {
doReturn(redisConnection).when(redisConnectionFactory).getConnection();
- doReturn(String.valueOf(1).getBytes(StandardCharsets.UTF_8)).when(redisConnection).get(any());
+ doReturn(String.valueOf(1).getBytes(StandardCharsets.UTF_8))
+ .when(redisConnection)
+ .get(any());
SimpleRqueueListenerContainerFactory factory = new SimpleRqueueListenerContainerFactory();
RqueueListenerConfig rqueueSystemConfig = createConfig(factory);
doReturn(redisConnectionFactory).when(beanFactory).getBean(RedisConnectionFactory.class);
@@ -117,7 +123,9 @@ void rqueueConfigSetConnectionFactoryFromBeanFactoryWithDifferentValue()
void rqueueConfigSetConnectionFactoryFromBeanFactoryWithLatestVersion()
throws IllegalAccessException {
doReturn(redisConnection).when(redisConnectionFactory).getConnection();
- doReturn(String.valueOf(2).getBytes(StandardCharsets.UTF_8)).when(redisConnection).get(any());
+ doReturn(String.valueOf(2).getBytes(StandardCharsets.UTF_8))
+ .when(redisConnection)
+ .get(any());
SimpleRqueueListenerContainerFactory factory = new SimpleRqueueListenerContainerFactory();
RqueueListenerConfig rqueueSystemConfig = createConfig(factory);
doReturn(redisConnectionFactory).when(beanFactory).getBean(RedisConnectionFactory.class);
@@ -154,7 +162,9 @@ void rqueueConfigInvalidDbVersion() throws IllegalAccessException {
@Test
void rqueueConfigDoesNotChangeConnectionFactory() throws IllegalAccessException {
doReturn(redisConnection).when(redisConnectionFactory).getConnection();
- doReturn(String.valueOf(2).getBytes(StandardCharsets.UTF_8)).when(redisConnection).get(any());
+ doReturn(String.valueOf(2).getBytes(StandardCharsets.UTF_8))
+ .when(redisConnection)
+ .get(any());
SimpleRqueueListenerContainerFactory factory = new SimpleRqueueListenerContainerFactory();
factory.setRedisConnectionFactory(redisConnectionFactory);
RqueueListenerConfig rqueueSystemConfig = createConfig(factory);
@@ -183,7 +193,5 @@ void getMessageTemplateSetTemplateInFactory() throws IllegalAccessException {
assertEquals(template, factory.getRqueueMessageTemplate());
}
- private class RqueueListenerConfig extends RqueueListenerBaseConfig {
-
- }
+ private class RqueueListenerConfig extends RqueueListenerBaseConfig {}
}
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/SimpleRqueueListenerContainerFactoryTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/SimpleRqueueListenerContainerFactoryTest.java
index faee461c..43f94469 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/SimpleRqueueListenerContainerFactoryTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/config/SimpleRqueueListenerContainerFactoryTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -84,9 +84,8 @@ void setRqueueMessageHandler() {
@Test
void getRqueueMessageHandler() {
- assertNotNull(
- simpleRqueueListenerContainerFactory.getRqueueMessageHandler(
- new DefaultMessageConverterProvider()));
+ assertNotNull(simpleRqueueListenerContainerFactory.getRqueueMessageHandler(
+ new DefaultMessageConverterProvider()));
}
@Test
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/converter/GenericMessageConverterTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/converter/GenericMessageConverterTest.java
index 8220adef..0b096b49 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/converter/GenericMessageConverterTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/converter/GenericMessageConverterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -88,16 +88,14 @@ void toMessage() {
@Test
void toMessageSet() {
- assertNull(
- genericMessageConverter.toMessage(
- Collections.singleton("Foo"), RqueueMessageHeaders.emptyMessageHeaders()));
+ assertNull(genericMessageConverter.toMessage(
+ Collections.singleton("Foo"), RqueueMessageHeaders.emptyMessageHeaders()));
}
@Test
void toMessageEmptyList() {
- assertNull(
- genericMessageConverter.toMessage(
- Collections.emptyList(), RqueueMessageHeaders.emptyMessageHeaders()));
+ assertNull(genericMessageConverter.toMessage(
+ Collections.emptyList(), RqueueMessageHeaders.emptyMessageHeaders()));
}
@Test
@@ -227,8 +225,7 @@ void multiLevelGenericTestDataFixedTypeToFromMessage() {
@Test
@Disabled
void foo() {
- MappingRegistrar> m = new MappingRegistrar>() {
- };
+ MappingRegistrar> m = new MappingRegistrar>() {};
m.seeIt();
MultiGenericTestDataSameType m2 = new MultiGenericTestDataSameType<>();
m2.seeIt();
@@ -328,10 +325,9 @@ private void innerSeeIt(Type type) {
if (type instanceof TypeVariable) {
Type[] bounds = ((TypeVariable>) type).getBounds();
- String s =
- Arrays.stream(bounds)
- .map(Type::getTypeName)
- .collect(Collectors.joining(", ", "[", "]"));
+ String s = Arrays.stream(bounds)
+ .map(Type::getTypeName)
+ .collect(Collectors.joining(", ", "[", "]"));
System.out.print(s);
}
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/converter/JsonMessageConverterTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/converter/JsonMessageConverterTest.java
index 9a25308c..71170906 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/converter/JsonMessageConverterTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/converter/JsonMessageConverterTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2023 Sonu Kumar
+ * Copyright (c) 2021-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -31,12 +31,16 @@
import org.junit.jupiter.api.Test;
import org.springframework.messaging.Message;
import org.springframework.messaging.converter.MessageConverter;
+import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.ObjectMapper;
+import tools.jackson.databind.json.JsonMapper;
@CoreUnitTest
class JsonMessageConverterTest extends TestBase {
- private final ObjectMapper objectMapper = new ObjectMapper();
+ private final ObjectMapper objectMapper = JsonMapper.builder()
+ .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
+ .build();
private final MessageConverter messageConverter = new JsonMessageConverter();
private final MessageConverter messageConverter2 = new JsonMessageConverter(objectMapper);
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/core/MessageSchedulerDisabledTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/core/MessageSchedulerDisabledTest.java
index 6f29bb08..822808bb 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/core/MessageSchedulerDisabledTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/core/MessageSchedulerDisabledTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2023 Sonu Kumar
+ * Copyright (c) 2020-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -48,10 +48,13 @@ class MessageSchedulerDisabledTest extends TestBase {
private final String slowQueue = "slow-queue";
private final QueueDetail slowQueueDetail = TestUtils.createQueueDetail(slowQueue);
+
@Mock
private RqueueSchedulerConfig rqueueSchedulerConfig;
+
@Mock
private RqueueConfig rqueueConfig;
+
@Mock
private RedisTemplate redisTemplate;
diff --git a/rqueue-core/src/test/java/com/github/sonus21/rqueue/core/MessageSchedulerTest.java b/rqueue-core/src/test/java/com/github/sonus21/rqueue/core/MessageSchedulerTest.java
index bafefd9a..8f948a8f 100644
--- a/rqueue-core/src/test/java/com/github/sonus21/rqueue/core/MessageSchedulerTest.java
+++ b/rqueue-core/src/test/java/com/github/sonus21/rqueue/core/MessageSchedulerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2023 Sonu Kumar
+ * Copyright (c) 2019-2026 Sonu Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
@@ -47,14 +47,19 @@ class MessageSchedulerTest extends TestBase {
private final QueueDetail slowQueueDetail = TestUtils.createQueueDetail(slowQueue);
private final QueueDetail fastQueueDetail = TestUtils.createQueueDetail(fastQueue);
private final Map