Esempio n. 1
0
 def __init__(self,
              endpoint,
              auth_config,
              *,
              loop=None,
              connection=None,
              encoding='UTF-8',
              debug=False,
              **kwargs):
     self.loop = loop or get_running_loop()
     self.running = False
     self.error = None
     self.endpoint = endpoint
     self.entity = urlparse(endpoint).path.strip('/')
     self.mgmt_target = self.entity + "/$management"
     self.debug = debug
     self.encoding = encoding
     self.auth_config = auth_config
     self.connection = connection
     self.auto_reconnect = kwargs.pop('auto_reconnect', True)
     self.properties = create_properties()
     self.error_policy = kwargs.pop('error_policy', None)
     self.handler_kwargs = kwargs
     if not self.error_policy:
         max_retries = kwargs.pop('max_message_retries', 3)
         is_session = hasattr(self, 'session_id')
         self.error_policy = _ServiceBusErrorPolicy(max_retries=max_retries,
                                                    is_session=is_session)
     self._handler = None
     self._build_handler()
Esempio n. 2
0
 def __init__(self, endpoint, auth_config, connection=None, encoding='UTF-8', debug=False, **kwargs):
     self.running = False
     self.error = None
     self.endpoint = endpoint
     self.entity = urlparse(endpoint).path.strip('/')
     self.mgmt_target = self.entity + "/$management"
     self.debug = debug
     self.encoding = encoding
     self.auth_config = auth_config
     self.connection = connection
     self.auto_reconnect = kwargs.pop('auto_reconnect', True)
     self.properties = create_properties()
     self.error_policy = kwargs.pop('error_policy', None)
     self.handler_kwargs = kwargs
     if not self.error_policy:
         max_retries = kwargs.pop('max_message_retries', 3)
         is_session = hasattr(self, 'session_id')
         self.error_policy = _ServiceBusErrorPolicy(max_retries=max_retries, is_session=is_session)
     self._handler = None
     self._build_handler()