Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions pulsar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ def __init__(self, service_url,
message_listener_threads=1,
concurrent_lookup_requests=50000,
log_conf_file_path=None,
stats_interval_in_seconds=600,
use_tls=False,
tls_trust_certs_file_path=None,
tls_allow_insecure_connection=False,
Expand Down Expand Up @@ -520,6 +521,9 @@ def __init__(self, service_url,
log_conf_file_path: str, optional
This parameter is deprecated and makes no effect. It's retained only for compatibility.
Use `logger` to customize a logger.
stats_interval_in_seconds: int, default=600
Set the interval between each stats information update. Stats are printed and/or
passed to the statistics listener at this interval. Set to 0 to disable stats collection.
use_tls: bool, default=False
Configure whether to use TLS encryption on the connection. This setting is deprecated.
TLS will be automatically enabled if the ``serviceUrl`` is set to ``pulsar+ssl://`` or ``https://``
Expand Down Expand Up @@ -560,6 +564,7 @@ def __init__(self, service_url,
_check_type(int, message_listener_threads, 'message_listener_threads')
_check_type(int, concurrent_lookup_requests, 'concurrent_lookup_requests')
_check_type_or_none(str, log_conf_file_path, 'log_conf_file_path')
_check_type(int, stats_interval_in_seconds, 'stats_interval_in_seconds')
_check_type(bool, use_tls, 'use_tls')
_check_type_or_none(str, tls_trust_certs_file_path, 'tls_trust_certs_file_path')
_check_type(bool, tls_allow_insecure_connection, 'tls_allow_insecure_connection')
Expand All @@ -574,6 +579,7 @@ def __init__(self, service_url,
conf.io_threads(io_threads)
conf.message_listener_threads(message_listener_threads)
conf.concurrent_lookup_requests(concurrent_lookup_requests)
conf.stats_interval_in_seconds(stats_interval_in_seconds)

if isinstance(logger, logging.Logger):
conf.set_logger(self._prepare_logger(logger))
Expand Down
3 changes: 3 additions & 0 deletions src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ void export_config(py::module_& m) {
.def("concurrent_lookup_requests", &ClientConfiguration::getConcurrentLookupRequest)
.def("concurrent_lookup_requests", &ClientConfiguration::setConcurrentLookupRequest,
return_value_policy::reference)
.def("stats_interval_in_seconds", &ClientConfiguration::getStatsIntervalInSeconds)
.def("stats_interval_in_seconds", &ClientConfiguration::setStatsIntervalInSeconds,
return_value_policy::reference)
.def("use_tls", &ClientConfiguration::isUseTls)
.def("use_tls", &ClientConfiguration::setUseTls, return_value_policy::reference)
.def("tls_trust_certs_file_path", &ClientConfiguration::getTlsTrustCertsFilePath,
Expand Down
1 change: 1 addition & 0 deletions tests/pulsar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ def test_client_argument_errors(self):
self._check_value_error(lambda: Client(None))
self._check_value_error(lambda: Client(self.serviceUrl, authentication="test"))
self._check_value_error(lambda: Client(self.serviceUrl, operation_timeout_seconds="test"))
self._check_value_error(lambda: Client(self.serviceUrl, stats_interval_in_seconds="test"))
self._check_value_error(lambda: Client(self.serviceUrl, io_threads="test"))
self._check_value_error(lambda: Client(self.serviceUrl, message_listener_threads="test"))
self._check_value_error(lambda: Client(self.serviceUrl, concurrent_lookup_requests="test"))
Expand Down
Loading