Establish a connection to the message broker. Please use :meth:`connection_for_read` and :meth:`connection_for_write` instead, to convey the intent of use for this connection. Arguments: url: Either the URL or the hostname of the broker to use.
(self, hostname=None, userid=None, password=None,
virtual_host=None, port=None, ssl=None,
connect_timeout=None, transport=None,
transport_options=None, heartbeat=None,
login_method=None, failover_strategy=None, **kwargs)
| 997 | return self._connection(url or self.conf.broker_write_url, **kwargs) |
| 998 | |
| 999 | def connection(self, hostname=None, userid=None, password=None, |
| 1000 | virtual_host=None, port=None, ssl=None, |
| 1001 | connect_timeout=None, transport=None, |
| 1002 | transport_options=None, heartbeat=None, |
| 1003 | login_method=None, failover_strategy=None, **kwargs): |
| 1004 | """Establish a connection to the message broker. |
| 1005 | |
| 1006 | Please use :meth:`connection_for_read` and |
| 1007 | :meth:`connection_for_write` instead, to convey the intent |
| 1008 | of use for this connection. |
| 1009 | |
| 1010 | Arguments: |
| 1011 | url: Either the URL or the hostname of the broker to use. |
| 1012 | hostname (str): URL, Hostname/IP-address of the broker. |
| 1013 | If a URL is used, then the other argument below will |
| 1014 | be taken from the URL instead. |
| 1015 | userid (str): Username to authenticate as. |
| 1016 | password (str): Password to authenticate with |
| 1017 | virtual_host (str): Virtual host to use (domain). |
| 1018 | port (int): Port to connect to. |
| 1019 | ssl (bool, Dict): Defaults to the :setting:`broker_use_ssl` |
| 1020 | setting. |
| 1021 | transport (str): defaults to the :setting:`broker_transport` |
| 1022 | setting. |
| 1023 | transport_options (Dict): Dictionary of transport specific options. |
| 1024 | heartbeat (int): AMQP Heartbeat in seconds (``pyamqp`` only). |
| 1025 | login_method (str): Custom login method to use (AMQP only). |
| 1026 | failover_strategy (str, Callable): Custom failover strategy. |
| 1027 | **kwargs: Additional arguments to :class:`kombu.Connection`. |
| 1028 | |
| 1029 | Returns: |
| 1030 | kombu.Connection: the lazy connection instance. |
| 1031 | """ |
| 1032 | return self.connection_for_write( |
| 1033 | hostname or self.conf.broker_write_url, |
| 1034 | userid=userid, password=password, |
| 1035 | virtual_host=virtual_host, port=port, ssl=ssl, |
| 1036 | connect_timeout=connect_timeout, transport=transport, |
| 1037 | transport_options=transport_options, heartbeat=heartbeat, |
| 1038 | login_method=login_method, failover_strategy=failover_strategy, |
| 1039 | **kwargs |
| 1040 | ) |
| 1041 | |
| 1042 | def _connection(self, url, userid=None, password=None, |
| 1043 | virtual_host=None, port=None, ssl=None, |
no test coverage detected