From fbe89dfb423cb6bd7956e2823a6823c01815844c Mon Sep 17 00:00:00 2001 From: Max Novelli Date: Fri, 31 May 2024 15:19:21 +0200 Subject: [PATCH] adding wrdn message selection --- src/scicat_kafka.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/scicat_kafka.py b/src/scicat_kafka.py index 26535aa..9c6bb35 100644 --- a/src/scicat_kafka.py +++ b/src/scicat_kafka.py @@ -125,5 +125,11 @@ def wrdn_messages( logger.error("Consumer error: %s", message.error()) yield None else: - logger.info("Received message.") - yield _deserialise_wrdn(message.value(), logger) + # retrieve type of message + message_value = message.value() + message_type = message_value[4:8] + logger.info("Received message. Type : %s", message_type) + if message_value == b"wrdn": + yield _deserialise_wrdn(message.value(), logger) + else: + yield None