Package com.github.sonus21.rqueue.config
Class NatsBackendCondition
java.lang.Object
com.github.sonus21.rqueue.config.NatsBackendCondition
- All Implemented Interfaces:
org.springframework.context.annotation.Condition
public class NatsBackendCondition
extends Object
implements org.springframework.context.annotation.Condition
Spring
Condition that matches when the active rqueue backend is Backend.NATS.
Companion to RedisBackendCondition; together they ensure every Redis-shaped interface
gets exactly one bean (Redis impl when backend=redis, no-op stub when backend=nats) so
consumers don't need @Autowired(required = false) or null guards.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(org.springframework.context.annotation.ConditionContext ctx, org.springframework.core.type.AnnotatedTypeMetadata md)
-
Constructor Details
-
NatsBackendCondition
public NatsBackendCondition()
-
-
Method Details
-
matches
public boolean matches(org.springframework.context.annotation.ConditionContext ctx, org.springframework.core.type.AnnotatedTypeMetadata md) - Specified by:
matchesin interfaceorg.springframework.context.annotation.Condition
-