Commit 0afd8be5 authored by Matthias's avatar Matthias
Browse files

add type to json and change topicname

parent a88bfe4c
Pipeline #11460 passed with stages
in 5 minutes and 48 seconds
......@@ -46,6 +46,7 @@ class MonitorDrupalJsonApiInstitution(Resource):
requests.get('https://mb-wf1.memobase.unibas.ch/jsonapi/node/' +
'institution/' + topic_name).json()['data']
topicValue = {
'type': drupalResponse['type'],
'title': drupalResponse['attributes']['title'],
'field_address': drupalResponse['attributes']['field_address'],
'field_isil': drupalResponse['attributes']['field_isil'],
......@@ -64,7 +65,7 @@ class MonitorDrupalJsonApiInstitution(Resource):
producer = KafkaProducer(bootstrap_servers=current_app.config['kafka-broker-url'],
value_serializer=lambda m: json.dumps(m, ensure_ascii=False)
.encode('utf-8'))
producer.send('drupal-json-api-institutions', topicValue)
producer.send('drupal-json-api-input', topicValue)
except Exception as ex:
report += 'Exception' + str(ex) + '\n'
......
......@@ -46,6 +46,7 @@ class MonitorDrupalJsonApiRecordSet(Resource):
requests.get('https://mb-wf1.memobase.unibas.ch/jsonapi/node/' +
'institution/' + topic_name).json()['data']
topicValue = {
'type': drupalResponse['type'],
'title': drupalResponse['attributes']['title'],
'field_address': drupalResponse['attributes']['field_address'],
'field_isil': drupalResponse['attributes']['field_isil'],
......@@ -66,7 +67,7 @@ class MonitorDrupalJsonApiRecordSet(Resource):
producer = KafkaProducer(bootstrap_servers=current_app.config['kafka-broker-url'],
value_serializer=lambda m: json.dumps(m, ensure_ascii=False)
.encode('utf-8'))
producer.send('drupal-json-api-institutions', topicValue)
producer.send('drupal-json-api-input', topicValue)
except Exception as ex:
report += 'Exception' + str(ex) + '\n'
......
Markdown is supported
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