Skip to content

Commit

Permalink
Fix pulsar client not support init arguments other than service_url (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tsonglew committed Jul 28, 2024
1 parent 64ee67e commit 1ce6910
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
4 changes: 2 additions & 2 deletions skywalking/plugins/sw_pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def set_peer(value):
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):
Expand Down
17 changes: 16 additions & 1 deletion tests/plugin/data/sw_pulsar/services/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 16 additions & 1 deletion tests/plugin/data/sw_pulsar/services/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,22 @@
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,
Expand Down

0 comments on commit 1ce6910

Please sign in to comment.