Commit 50cdcbd4 authored by Jiahang Chen's avatar Jiahang Chen
Browse files

error handle by non-json formatted s3i messages

parent 2985e505
Pipeline #438533 passed with stages
in 50 seconds
...@@ -449,11 +449,12 @@ def __on_broker_callback(self, ch, method, properties, body): ...@@ -449,11 +449,12 @@ def __on_broker_callback(self, ch, method, properties, body):
pass pass
elif isinstance(body, int): elif isinstance(body, int):
return pass
elif isinstance(body, str): elif isinstance(body, str):
return pass
ch.basic_ack(method.delivery_tag) self.broker.receiver.acknowledge_message(method.delivery_tag)
try:
message_type = body.get("messageType") message_type = body.get("messageType")
if message_type == "userMessage": if message_type == "userMessage":
self.on_user_message(body) self.on_user_message(body)
...@@ -468,6 +469,8 @@ def __on_broker_callback(self, ch, method, properties, body): ...@@ -468,6 +469,8 @@ def __on_broker_callback(self, ch, method, properties, body):
else: else:
### TODO send user message reply back ### TODO send user message reply back
pass pass
except AttributeError:
pass
def __send_message_to_broker(self, receiver_endpoints, msg): def __send_message_to_broker(self, receiver_endpoints, msg):
try: try:
......
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