Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions rabbitmq_amqp_python_client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def _set_environment_connection_list(self, connections: []): # type: ignore

def _open_connections(self, reconnect_handlers: bool = False) -> None:

logger.debug("inside connection._open_connections creating connection")
if self._recovery_configuration.active_recovery is False:
self._conn = BlockingConnection(
url=self._addr,
Expand All @@ -123,7 +124,7 @@ def _open_connections(self, reconnect_handlers: bool = False) -> None:
)

if reconnect_handlers is True:

logger.debug("reconnecting managements, publishers and consumers handlers")
for i, management in enumerate(self._managements):
# Update the broken connection and sender in the management
self._managements[i]._update_connection(self._conn)
Expand Down Expand Up @@ -206,10 +207,6 @@ def _win_store_to_cert(
typing_extensions.assert_never(store)
return ca_cert

def _open(self) -> None:
self._management = Management(self._conn)
self._management.open()

def management(self) -> Management:
"""
Get the management interface for this connection.
Expand Down Expand Up @@ -329,7 +326,7 @@ def _on_disconnection(self) -> None:

except ConnectionException as e:
base_delay *= 2
logger.debug(
logger.error(
"Reconnection attempt failed",
"attempt",
attempt,
Expand All @@ -338,7 +335,7 @@ def _on_disconnection(self) -> None:
)
# maximum attempts reached without establishing a connection
if attempt == self._recovery_configuration.MaxReconnectAttempts - 1:
logger.debug("Not able to reconnect")
logger.error("Not able to reconnect")
raise ConnectionException
else:
continue
Expand Down