Skip to content

Commit a00faa2

Browse files
committed
Gate RqueueJobMetricsAggregatorService on Redis backend
The aggregator depends on RqueueLockManager (Redis-only) and RqueueQStatsDao (Redis-only); both were gated in the previous commit but the aggregator @component itself wasn't, so its constructor injection failed at startup with NoSuchBeanDefinitionException for RqueueLockManager when rqueue.backend=nats. Adding @conditional(RedisBackendCondition.class) on the aggregator keeps it out of the context on the NATS path; metrics aggregation is a Redis feature for v1 and the dashboard already hides the related panels. Assisted-By: Claude Code
1 parent 22eb046 commit a00faa2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

rqueue-core/src/main/java/com/github/sonus21/rqueue/web/service/RqueueJobMetricsAggregatorService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.github.sonus21.rqueue.web.service;
1818

1919
import com.github.sonus21.rqueue.common.RqueueLockManager;
20+
import com.github.sonus21.rqueue.config.RedisBackendCondition;
2021
import com.github.sonus21.rqueue.config.RqueueConfig;
2122
import com.github.sonus21.rqueue.config.RqueueWebConfig;
2223
import com.github.sonus21.rqueue.core.RqueueMessage;
@@ -51,11 +52,13 @@
5152
import org.springframework.beans.factory.annotation.Autowired;
5253
import org.springframework.context.ApplicationListener;
5354
import org.springframework.context.SmartLifecycle;
55+
import org.springframework.context.annotation.Conditional;
5456
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
5557
import org.springframework.stereotype.Component;
5658
import org.springframework.util.CollectionUtils;
5759

5860
@Component
61+
@Conditional(RedisBackendCondition.class)
5962
@Slf4j
6063
public class RqueueJobMetricsAggregatorService
6164
implements ApplicationListener<RqueueExecutionEvent>, DisposableBean, SmartLifecycle {

0 commit comments

Comments
 (0)