Skip to content

Commit 1ce6910

Browse files
authored
Fix pulsar client not support init arguments other than service_url (#351)
1 parent 64ee67e commit 1ce6910

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

skywalking/plugins/sw_pulsar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def set_peer(value):
4545
nonlocal _peer
4646
_peer = value
4747

48-
def _sw_init(self, service_url):
49-
__init(self, service_url)
48+
def _sw_init(self, service_url, *args, **kwargs):
49+
__init(self, service_url, *args, **kwargs)
5050
set_peer(service_url)
5151

5252
def _sw_send_func(_send):

tests/plugin/data/sw_pulsar/services/consumer.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,22 @@
1818
if __name__ == '__main__':
1919
import pulsar
2020

21-
client = pulsar.Client(service_url='pulsar://pulsar-server:6650')
21+
client = pulsar.Client(
22+
service_url='pulsar://pulsar-server:6650',
23+
authentication=None,
24+
operation_timeout_seconds=30,
25+
io_threads=1,
26+
message_listener_threads=1,
27+
concurrent_lookup_requests=50000,
28+
log_conf_file_path=None,
29+
use_tls=False,
30+
tls_trust_certs_file_path=None,
31+
tls_allow_insecure_connection=False,
32+
tls_validate_hostname=False,
33+
logger=None,
34+
connection_timeout_ms=10000,
35+
listener_name=None
36+
)
2237
consumer = client.subscribe('sw-topic', 'sw-subscription')
2338

2439
while True:

tests/plugin/data/sw_pulsar/services/producer.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@
2222
from pulsar import BatchingType
2323

2424
app = Flask(__name__)
25-
client = pulsar.Client(service_url='pulsar://pulsar-server:6650')
25+
client = pulsar.Client(
26+
service_url='pulsar://pulsar-server:6650',
27+
authentication=None,
28+
operation_timeout_seconds=30,
29+
io_threads=1,
30+
message_listener_threads=1,
31+
concurrent_lookup_requests=50000,
32+
log_conf_file_path=None,
33+
use_tls=False,
34+
tls_trust_certs_file_path=None,
35+
tls_allow_insecure_connection=False,
36+
tls_validate_hostname=False,
37+
logger=None,
38+
connection_timeout_ms=10000,
39+
listener_name=None
40+
)
2641
producer = client.create_producer(
2742
'sw-topic',
2843
block_if_queue_full=True,

0 commit comments

Comments
 (0)