Skip to content

Commit

Permalink
adding wrdn message selection
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrosx committed May 31, 2024
1 parent 59113a9 commit fbe89df
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/scicat_kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fbe89df

Please sign in to comment.