in workspace/src/greengrass-bridge/greengrass_bridge/app.py [0:0]
def publish_to_iot(self, topic, msg):
self.get_logger().info("Publishing message to the cloud: %s" % msg.data)
operation = self.ipc_client.new_publish_to_iot_core()
operation.activate(model.PublishToIoTCoreRequest(
topic_name=topic,
qos=model.QOS.AT_LEAST_ONCE,
payload=json.dumps(msg.data).encode(),
))
future = operation.get_response()
future.result(self.timeout)