Interface RedisConnectorService
- All Known Implementing Classes:
RedisConnectorServiceImpl
public interface RedisConnectorService
Service interface for managing multiple named Redis connections.
Connections are discovered from environment variables with the
CONNECTOR_REDIS_ prefix. Each connection is identified by a unique name
extracted from the environment variable pattern
CONNECTOR_REDIS_<NAME>_CONFIG.
Logging contract:
INFO— lifecycle events (initialization start, connection count, connection created)WARNING— recoverable failures (missing config when exit-on-failure is disabled)SEVERE— fatal failures that will cause server shutdown
- See Also:
-
Method Details
-
init
Initializes all Redis connections discovered from environment variables.- Throws:
ConnectionInitException- if a connection with exit-on-failure enabled fails to initialize
-
shutdown
void shutdown()Shuts down all managed Redis connections. -
getConnection
Retrieves a Redis connection by its identifier.- Parameters:
id- the connection identifier (case-sensitive, as extracted from environment variables)- Returns:
- an
Optionalcontaining the connection, or empty if no connection exists with that id
-