Commit 2a3ce60d authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Add logging message to debug

parent 335a3d74
Pipeline #32947 passed with stages
in 2 minutes and 23 seconds
......@@ -11,7 +11,6 @@ from requests.auth import HTTPBasicAuth
class UpdateRecordSet(Resource):
producer = KafkaProducer(bootstrap_servers=current_app.config['kafka-broker-url'],
value_serializer=lambda m: json.dumps(m, ensure_ascii=False)
.encode('utf-8'))
......@@ -223,13 +222,16 @@ class UpdateRecordSet(Resource):
def send_message(self, result_topic_value, record_set_id):
headers = [
('recordSetId', bytes(record_set_id)),
('recordSetId', bytes(record_set_id, encoding='utf-8')),
('sessionId', uuid.uuid4()),
('institutionId', bytes('none')),
('isPublished', bytes(result_topic_value['status']))
('institutionId', bytes('none', encoding='utf-8')),
('isPublished', bytes(result_topic_value['status'], encoding='utf-8'))
]
try:
key = bytes(result_topic_value.get('field_memobase_id'), encoding='utf-8')
current_app.logger.debug(
f'Send message: key={key}, headers={headers}, '
f'message: {json.dumps(result_topic_value, ensure_ascii=False)}')
self.producer.send(current_app.config['topic-drupal-export'], result_topic_value,
key=key, headers=headers)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment