添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!

Hi!

I'm developing a solution based on microservices (aws lambda), which are basically small python codes which runs in a non managed infrastructure and got destroyed after that and I only pay by the time which the python code token to run.

I'm using that to retrive information from my qlik sense objects and store it somewhere else using the JSON API/ websockets.

The point is:
Because of the micro service nature, I can run 1,5, 10 instances in parallel. I'm wondering how would be the best pratices to deal with this paralelism working with the websockets from the JSON API, as currently I'm facing this error a lot of times:

File "/opt/python/lib/python3.7/site-packages/websocket/_socket.py", line 126, in recv "Connection is already closed.") websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed.

This is the piece of iteraction which created the error:

        req = {
            "id":self.id,
            "jsonrpc": "2.0",
            "method": "OpenDoc",
            "handle": req_handle,
            "params": [
                f"{qs_app_id}"
        self.ws.send(json.dumps(req))
        authentication = self.ws.recv()
        connection = self.ws.recv()

I might be missing a best pratice dealing with those parallel extractions, right?
Thank you in advance!