This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git


The following commit(s) were added to refs/heads/master by this push:
     new 1ce6910  Fix pulsar client not support init arguments other than 
service_url (#351)
1ce6910 is described below

commit 1ce69108e33e9f72f87ef53619660aee2e5c033a
Author: Tsonglew <[email protected]>
AuthorDate: Sun Jul 28 12:15:50 2024 +0800

    Fix pulsar client not support init arguments other than service_url (#351)
---
 skywalking/plugins/sw_pulsar.py                  |  4 ++--
 tests/plugin/data/sw_pulsar/services/consumer.py | 17 ++++++++++++++++-
 tests/plugin/data/sw_pulsar/services/producer.py | 17 ++++++++++++++++-
 3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/skywalking/plugins/sw_pulsar.py b/skywalking/plugins/sw_pulsar.py
index 33b24a3..8976f81 100644
--- a/skywalking/plugins/sw_pulsar.py
+++ b/skywalking/plugins/sw_pulsar.py
@@ -45,8 +45,8 @@ def install():
         nonlocal _peer
         _peer = value
 
-    def _sw_init(self, service_url):
-        __init(self, service_url)
+    def _sw_init(self, service_url, *args, **kwargs):
+        __init(self, service_url, *args, **kwargs)
         set_peer(service_url)
 
     def _sw_send_func(_send):
diff --git a/tests/plugin/data/sw_pulsar/services/consumer.py 
b/tests/plugin/data/sw_pulsar/services/consumer.py
index fc444b1..ac842ef 100644
--- a/tests/plugin/data/sw_pulsar/services/consumer.py
+++ b/tests/plugin/data/sw_pulsar/services/consumer.py
@@ -18,7 +18,22 @@
 if __name__ == '__main__':
     import pulsar
 
-    client = pulsar.Client(service_url='pulsar://pulsar-server:6650')
+    client = pulsar.Client(
+        service_url='pulsar://pulsar-server:6650',
+        authentication=None,
+        operation_timeout_seconds=30,
+        io_threads=1,
+        message_listener_threads=1,
+        concurrent_lookup_requests=50000,
+        log_conf_file_path=None,
+        use_tls=False,
+        tls_trust_certs_file_path=None,
+        tls_allow_insecure_connection=False,
+        tls_validate_hostname=False,
+        logger=None,
+        connection_timeout_ms=10000,
+        listener_name=None
+    )
     consumer = client.subscribe('sw-topic', 'sw-subscription')
 
     while True:
diff --git a/tests/plugin/data/sw_pulsar/services/producer.py 
b/tests/plugin/data/sw_pulsar/services/producer.py
index 9505f82..7cb0b3c 100644
--- a/tests/plugin/data/sw_pulsar/services/producer.py
+++ b/tests/plugin/data/sw_pulsar/services/producer.py
@@ -22,7 +22,22 @@ if __name__ == '__main__':
     from pulsar import BatchingType
 
     app = Flask(__name__)
-    client = pulsar.Client(service_url='pulsar://pulsar-server:6650')
+    client = pulsar.Client(
+        service_url='pulsar://pulsar-server:6650',
+        authentication=None,
+        operation_timeout_seconds=30,
+        io_threads=1,
+        message_listener_threads=1,
+        concurrent_lookup_requests=50000,
+        log_conf_file_path=None,
+        use_tls=False,
+        tls_trust_certs_file_path=None,
+        tls_allow_insecure_connection=False,
+        tls_validate_hostname=False,
+        logger=None,
+        connection_timeout_ms=10000,
+        listener_name=None
+    )
     producer = client.create_producer(
         'sw-topic',
         block_if_queue_full=True,

Reply via email to