Interface KafkaConnectorService
- All Known Implementing Classes:
KafkaConnectorServiceImpl
public interface KafkaConnectorService
Service interface for managing multiple named Kafka connections.
Connections are discovered from environment variables with the
CONNECTOR_KAFKA_ prefix. Each connection is identified by a unique name
extracted from the environment variable pattern
CONNECTOR_KAFKA_<NAME>_CONFIG.
Logging contract:
INFO— lifecycle events (initialization start, connection count, configuration loaded)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 Kafka 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 Kafka connections, gracefully closing all tracked clients. -
getConnection
Retrieves a Kafka 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
-