Skip to content

Commit

Permalink
Add pulsar plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
CodePrometheus committed May 5, 2024
1 parent d8974df commit f5bd8e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion skywalking/plugins/sw_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
link_vector = ['https://github.com/elastic/elasticsearch-py']
support_matrix = {
'elasticsearch': {
'>=3.7': ['7.13', '7.14', '7.15'],
'>=3.7': ['7.13'],
}
}
note = """"""
Expand Down
2 changes: 1 addition & 1 deletion tests/plugin/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def validate(self, expected_file_name=None):

if response.status_code != 200:
res = requests.get('http://localhost:12800/receiveData')
print('receiveData: ', res)
print('receiveData status_code: ', res.status_code)
actual_data = yaml.dump(yaml.load(res.content, Loader=Loader))
print('actual_data: ', actual_data)

Expand Down
14 changes: 6 additions & 8 deletions tests/plugin/data/sw_pulsar/services/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@

if __name__ == '__main__':
from flask import Flask, jsonify
app = Flask(__name__)
print("my|producer starting...")
import pulsar
from pulsar import BatchingType

app = Flask(__name__)
client = pulsar.Client(service_url='pulsar://pulsar-server:6650')
producer = client.create_producer(
'sw-topic',
Expand All @@ -34,13 +35,10 @@

@app.route('/users', methods=['POST', 'GET'])
def application():
try:
producer.send('I love skywalking 3 thousand'.encode('utf-8'), None)
producer.flush()
producer.close()
print("my|producer send ok")
except Exception as e:
print('Failed to send message: %s', e)
producer.send('I love skywalking 3 thousand'.encode('utf-8'), None)
producer.flush()
producer.close()
print("my|producer send ok")
return jsonify({'song': 'Nocturne', 'artist': 'Jay Chou'})

PORT = 9090
Expand Down

0 comments on commit f5bd8e3

Please sign in to comment.