kafka.net.manager
- class kafka.net.manager.KafkaConnectionManager(net=None, **configs)[source]
- DEFAULT_CONFIG = {'api_version': None, 'bootstrap_servers': 'localhost:9092', 'client_dns_lookup': 'use_all_dns_ips', 'client_id': 'kafka-python-3.1.0.dev', 'client_software_name': 'kafka-python', 'client_software_version': '3.1.0.dev', 'connections_max_idle_ms': 540000, 'default_api_timeout_ms': 60000, 'max_in_flight_requests_per_connection': 5, 'metadata_max_age_ms': 300000, 'metric_group_prefix': '', 'metrics': None, 'proxy_url': None, 'receive_message_max_bytes': 1000000, 'reconnect_backoff_max_ms': 30000, 'reconnect_backoff_ms': 50, 'request_timeout_ms': 30000, 'sasl_kerberos_domain_name': None, 'sasl_kerberos_name': None, 'sasl_kerberos_service_name': 'kafka', 'sasl_mechanism': None, 'sasl_oauth_token_provider': None, 'sasl_plain_password': None, 'sasl_plain_username': None, 'security_protocol': 'PLAINTEXT', 'selector': None, 'socket_connection_setup_timeout_max_ms': 30000, 'socket_connection_setup_timeout_ms': 10000, 'socket_options': [(6, 1, 1), (1, 9, 1)], 'ssl_cafile': None, 'ssl_certfile': None, 'ssl_check_hostname': True, 'ssl_context': None, 'ssl_crlfile': None, 'ssl_keyfile': None, 'ssl_password': None}
- auth_failure(node_id)[source]
Return the most recent auth-class failure for
node_id, or None if there is no sticky failure on record.
- property bootstrapped
- property broker_version
- call_soon(coro, *args)[source]
Accepts a coroutine / awaitable / function and schedules it on the event loop.
Thread-safe.
Returns: Future
- connection_delay(node_id)[source]
Connection delay in seconds.
Uses exponential backoff/retry with jitter. See KIP-144.
- get_connection(node_id, timeout_ms=None, pop_on_close=True, refresh_metadata_on_err=True, reset_backoff_on_connect=True)[source]
- least_loaded_node()[source]
Choose the node with fewest outstanding requests, with fallbacks.
This method will prefer a node with an existing connection (not throttled) with no in-flight-requests. If no such node is found, a node will be chosen randomly from all nodes that are not throttled or “blacked out” (i.e., are not subject to a reconnect backoff). If no node metadata has been obtained, will return a bootstrap node.
- Returns:
node_id or None if no suitable node was found
- property ssl_enabled