Commit faecba6
committed
Allow null connection factory in Redis template constructors
When rqueue.backend=nats the new rqueueConfig factory leaves
connectionFactory null. The downstream RqueueListenerBaseConfig's
getMessageTemplate() still calls
new RqueueMessageTemplateImpl(rqueueConfig.getConnectionFactory(),
rqueueConfig.getReactiveRedisConnectionFactory())
which previously threw inside RedisTemplate.afterPropertiesSet() because
the connection factory is required. The template bean isn't used on the
NATS path (the broker SPI handles all message ops) but Spring still
needs the bean type to satisfy autowires.
Both the parent (RqueueRedisTemplate) and the child constructor now
short-circuit on a null connection factory: redisTemplate stays null,
the DefaultScriptExecutor isn't constructed, and any actual Redis
operation will NPE loudly so a misconfiguration is easy to spot. This
unblocks the NATS Spring Boot context from loading without forcing a
Redis instance.
Assisted-By: Claude Code1 parent 4dda27e commit faecba6
2 files changed
Lines changed: 10 additions & 1 deletion
File tree
- rqueue-core/src/main/java/com/github/sonus21/rqueue
- common
- core/impl
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
0 commit comments