Skip to content

Commit 4dda27e

Browse files
committed
Loosen Redis-coupled @Autowired in two more *Impl classes
RqueueEndpointManagerImpl and RqueueMessageManagerImpl are public-API beans constructed regardless of backend, so their constructor-time autowires fail when the gated Redis beans aren't created on the NATS path: - RqueueEndpointManagerImpl.{rqueueUtilityService, rqueueSystemConfigDao} - RqueueMessageManagerImpl.rqueueLockManager All three become @Autowired(required=false). The methods that touch them are admin/dashboard endpoints (pauseUnpauseQueue, deleteAll, getConfigByName) — Redis-only by design, gated at the controller layer in earlier commits, so a null reference here is acceptable for v1 and well outside the e2e produce-and-consume path. Assisted-By: Claude Code
1 parent d03d8cd commit 4dda27e

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueEndpointManagerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@
4242

4343
public class RqueueEndpointManagerImpl extends BaseMessageSender implements RqueueEndpointManager {
4444

45-
@Autowired
45+
// Both Redis-only — absent on the NATS backend; the dashboard / system-config endpoints
46+
// they back are gated by RedisBackendCondition and won't be invoked when these are null.
47+
@Autowired(required = false)
4648
private RqueueUtilityService rqueueUtilityService;
4749

48-
@Autowired
50+
@Autowired(required = false)
4951
private RqueueSystemConfigDao rqueueSystemConfigDao;
5052

5153
public RqueueEndpointManagerImpl(

rqueue-core/src/main/java/com/github/sonus21/rqueue/core/impl/RqueueMessageManagerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
@Slf4j
4545
public class RqueueMessageManagerImpl extends BaseMessageSender implements RqueueMessageManager {
4646

47-
@Autowired
47+
// Redis-only — null when rqueue.backend=nats; deletion APIs that need it are no-op
48+
// on the NATS path (the broker manages its own delivery state via JetStream).
49+
@Autowired(required = false)
4850
private RqueueLockManager rqueueLockManager;
4951

5052
public RqueueMessageManagerImpl(

0 commit comments

Comments
 (0)