You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move Redis-only impls from rqueue-core to rqueue-redis
Continues the rqueue-core/rqueue-redis split. Anything that's intrinsically
Redis-shaped (Lua scripts, ZSET pollers, RedisTemplate-bound DAOs) moves to
rqueue-redis; anything backend-agnostic (registry orchestration, metrics
SPI) stays in core and gains a backend-shaped store interface.
Moved to rqueue-redis under com.github.sonus21.rqueue.redis.* :
- core/MessageScheduler (abstract base)
- core/ScheduledQueueMessageScheduler (delayed -> ready ZSET poller)
- core/ProcessingQueueMessageScheduler (ack-window expiry poller)
- core/RedisScheduleTriggerHandler (pub/sub trigger helper)
- common/impl/RqueueLockManagerImpl (Lua-script-backed distributed lock)
Tests for these moved alongside; only added imports for things that were
package-local before the move and switched the package declarations.
RqueueQueueMetrics (the Redis-only convenience class) is deleted — its
callers (SpringTestBase, MetricTest) now go through RqueueQueueMetricsProvider,
which is the existing backend-agnostic SPI. The Provider gains three
default-method overloads taking (queueName, priority); RedisRqueueQueueMetricsProvider
overrides them to read priority sub-queues, NATS keeps the default (no
priority sub-queues there). Both providers now swallow QueueDoesNotExist
and return 0 so callers can use the values directly as gauge readings.
Worker registry split (parallel change kept in this commit): the impl is
backend-agnostic and lives in rqueue-core; storage moves behind a new
WorkerRegistryStore SPI with Redis (RedisWorkerRegistryStore) and NATS
JetStream KV (NatsWorkerRegistryStore) implementations. The stale
RqueueWorkerRegistryImplTest (written against the old single-arg
constructor) is removed; coverage will come back via store-shaped tests.
RqueueRedisListenerConfig is updated to wire the new Redis impls and the
RedisWorkerRegistryStore. RqueueNatsAutoConfig wires the NATS counterpart.
All 490 unit tests across rqueue-core (368), rqueue-redis (93), and
rqueue-nats (29) pass.
Assisted-By: Claude Code
|`rqueue-queue-config`| Per-queue `QueueConfig` records (registered queues, DLQ wiring, flags). | No TTL. Entries persist until explicitly overwritten. |[`NatsRqueueSystemConfigDao`](rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/dao/NatsRqueueSystemConfigDao.java) (`@Conditional(NatsBackendCondition)`) |
283
+
|`rqueue-jobs`|`RqueueJob` execution history per message id. | TTL captured from the first `createJob`/`save` call's `expiry` argument; bucket-level so it applies uniformly. |[`NatsRqueueJobDao`](rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/dao/NatsRqueueJobDao.java)|
284
+
|`rqueue-locks`| Distributed locks (scheduler leadership, message-level locks). | TTL captured from the first `acquireLock` call's `duration` argument. |[`NatsRqueueLockManager`](rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/lock/NatsRqueueLockManager.java)|
285
+
|`rqueue-message-metadata`| Per-message metadata (delivery status, retry count, dead-letter flags). | No TTL at the bucket. Per-write `ttl` arguments are ignored on this v1 impl. |[`NatsRqueueMessageMetadataService`](rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/service/NatsRqueueMessageMetadataService.java)|
286
+
|`rqueue-workers`| Worker process info (host, pid, version, last-seen). | TTL = `rqueue.workerRegistry.workerTtl` (captured on first heartbeat). |[`NatsWorkerRegistryStore`](rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/worker/NatsWorkerRegistryStore.java)|
287
+
|`rqueue-worker-heartbeats`| Per-(queue, worker) heartbeats. Keys flattened as `<queue>__<worker>`. | TTL = `rqueue.workerRegistry.queueTtl` (captured on first refresh; falls back to 1 h if registry not enabled). |[`NatsWorkerRegistryStore`](rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/worker/NatsWorkerRegistryStore.java)|
288
+
289
+
### How buckets are configured
290
+
291
+
-**Lazy, code-driven creation.** Each store / dao calls `kvm.create(KeyValueConfiguration...)`
292
+
the first time it is touched after startup. There is no `application.yml` switch to disable
293
+
this, and there is no provisioning step you need to run by hand — but the JetStream account
294
+
used by your `Connection` bean must have permission to create KV buckets (i.e. JetStream must
295
+
be enabled and account limits must allow it).
296
+
-**TTL is fixed at bucket creation.** All buckets that take a `ttl` snapshot the value at
297
+
creation. Changing the corresponding rqueue property after the bucket exists has no effect
298
+
until the bucket is deleted out-of-band and recreated. This matches NATS KV semantics — the
299
+
bucket's `maxAge` is immutable.
300
+
-**No bucket per queue.** All queues share the same buckets above; per-queue scoping is done
301
+
via the key prefix (`rqueue.workerRegistry.queueKey(queueName)`, etc.).
302
+
-**Connection wiring.** The `io.nats.client.Connection` bean comes from
0 commit comments