Skip to content
Snippets Groups Projects
Commit 26630e47 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Webservice: Update Kafka config to use EuXFEL broker

parent 943f4522
No related branches found
No related tags found
1 merge request!951Webservice: Update Kafka config to use EuXFEL broker
...@@ -23,11 +23,14 @@ metadata-client: ...@@ -23,11 +23,14 @@ metadata-client:
base-api-url: "https://in.xfel.eu/metadata/api/" base-api-url: "https://in.xfel.eu/metadata/api/"
kafka: kafka:
brokers: producer-config:
- it-kafka-broker01.desy.de bootstrap-servers:
- it-kafka-broker02.desy.de - "exflwgs06.desy.de"
- it-kafka-broker03.desy.de security_protocol: "SASL_PLAINTEXT"
topic: xfel-test-offline-cal sasl_mechanism: "PLAIN"
sasl_plain_username: "cal"
# sasl_plain_password: # Configure per-user
topic: cal.offline-corrections
correct: correct:
in-folder: /gpfs/exfel/exp/{instrument}/{cycle}/p{proposal}/raw in-folder: /gpfs/exfel/exp/{instrument}/{cycle}/p{proposal}/raw
......
...@@ -44,9 +44,9 @@ class NoOpProducer: ...@@ -44,9 +44,9 @@ class NoOpProducer:
def init_kafka_producer(config): def init_kafka_producer(config):
try: try:
return KafkaProducer( return KafkaProducer(
bootstrap_servers=config['kafka']['brokers'],
value_serializer=lambda d: json.dumps(d).encode('utf-8'), value_serializer=lambda d: json.dumps(d).encode('utf-8'),
max_block_ms=2000, # Don't get stuck trying to send Kafka messages max_block_ms=2000, # Don't get stuck trying to send Kafka messages
**config['kafka']['producer-config']
) )
except KafkaError: except KafkaError:
log.warning("Problem initialising Kafka producer; " log.warning("Problem initialising Kafka producer; "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment