Commit 60114f30 authored by Jiahang Chen's avatar Jiahang Chen
Browse files

add logs for service request and move topic append to end

parent 98f76bf4
Pipeline #560110 passed with stage
in 10 seconds
...@@ -544,7 +544,7 @@ def receive(): ...@@ -544,7 +544,7 @@ def receive():
target=self.broker.receive, target=self.broker.receive,
args=(self.__endpoint, self.__on_broker_callback), args=(self.__endpoint, self.__on_broker_callback),
).start() ).start()
time.sleep(0.5)
else: else:
self.broker.maybe_reconnect(self.access_token) self.broker.maybe_reconnect(self.access_token)
...@@ -798,7 +798,9 @@ def on_service_request(self, body_json): ...@@ -798,7 +798,9 @@ def on_service_request(self, body_json):
:param body_json: ServiceRequest :param body_json: ServiceRequest
""" """
__log = "[S3I][Broker]: You have received a S3I-B ServiceRequest" __log = "[S3I][Broker]: You have received a S3I-B ServiceRequest" + json.dumps(body_json, indent=2)
APP_LOGGER.info(__log)
service_type = body_json.get("serviceType") service_type = body_json.get("serviceType")
parameters = body_json.get("parameters") parameters = body_json.get("parameters")
service_reply = ServiceReply() service_reply = ServiceReply()
...@@ -1008,8 +1010,7 @@ def on_custom_event_request(self, msg): ...@@ -1008,8 +1010,7 @@ def on_custom_event_request(self, msg):
) )
__log = "[S3I][Broker]: Validation of RQL syntax: {}".format(subscription_status) __log = "[S3I][Broker]: Validation of RQL syntax: {}".format(subscription_status)
APP_LOGGER.info((__log)) APP_LOGGER.info((__log))
if subscription_status:
self.__custom_event_topics.append(topic)
event_sub_reply = CustomEventReply() event_sub_reply = CustomEventReply()
event_sub_reply.fillCustomEventReply( event_sub_reply.fillCustomEventReply(
sender=self.thing_id, sender=self.thing_id,
...@@ -1031,6 +1032,9 @@ def on_custom_event_request(self, msg): ...@@ -1031,6 +1032,9 @@ def on_custom_event_request(self, msg):
else: else:
__log = "[S3I[Broker]: " + res.text __log = "[S3I[Broker]: " + res.text
APP_LOGGER.info(__log) APP_LOGGER.info(__log)
if subscription_status:
self.__custom_event_topics.append(topic)
@staticmethod @staticmethod
def on_event_message(msg): def on_event_message(msg):
......
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