Class RabbitMQConnectorServiceImpl
java.lang.Object
fr.codinbox.connector.commons.rabbitmq.RabbitMQConnectorServiceImpl
- All Implemented Interfaces:
RabbitMQConnectorService
Default implementation of
RabbitMQConnectorService that discovers and manages
RabbitMQ connections from environment variables.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new RabbitMQ connector service. -
Method Summary
-
Constructor Details
-
RabbitMQConnectorServiceImpl
Creates a new RabbitMQ connector service.- Parameters:
logger- the logger for diagnostic messages
-
-
Method Details
-
init
Description copied from interface:RabbitMQConnectorServiceInitializes all RabbitMQ connections discovered from environment variables.- Specified by:
initin interfaceRabbitMQConnectorService- Throws:
ConnectionInitException- if a connection with exit-on-failure enabled fails to initialize
-
shutdown
public void shutdown()Description copied from interface:RabbitMQConnectorServiceShuts down all managed RabbitMQ connections, closing channels and connections.- Specified by:
shutdownin interfaceRabbitMQConnectorService
-
getConnection
Description copied from interface:RabbitMQConnectorServiceRetrieves a RabbitMQ connection by its identifier.- Specified by:
getConnectionin interfaceRabbitMQConnectorService- 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
-