2 Replies Latest reply on Jul 20, 2016 2:55 AM by Toni Juvani

    Keep alive to prevent timeout for embedded Tableau view HTTP connections

    Toni Juvani

      Hi,

       

      We are using Tableau as an embedded object on a HTML page in our application. The application is hosted so that users access it through Amazon AWS CloudFormation. The setup works fine, but whenever I change a parameter on the workbook and the subsequent loading time exceeds 30 seconds, an error is thrown.

       

      This is due to CloudFormation having a hard coded timeout of 30 seconds. AWS suggested that I could prevent the timeout with a by keeping it alive with HTTP requests sent every 10 seconds or so. I'm now thinking that one option could be to add call to a function (e.g. Ping()) at OnFirstInteractive, call some viz server function that goes to the server (e.g. getUrl()) and then let it call itself again after a 10 seconds.

       

      This way I might be able to keep the connection alive over the 30 second timout. However, I'm wondering whether this is a common use case and if there already would be something built in? Has someone else implemented anything like this?

       

      Br,

      Toni

        • 1. Re: Keep alive to prevent timeout for embedded Tableau view HTTP connections
          Toni Juvani

          Apparently calling Viz.getUrl() does not generate a call to the server. Suggestions on which function would do that are welcome.

          • 2. Re: Keep alive to prevent timeout for embedded Tableau view HTTP connections
            Toni Juvani

            Also it seems that the functions that generate a call to the server are ones that return a promise. This apparently means that if I refresh the data on the view by calling refreshDataAsync() (which returns a promise) and then after 10 seconds or so I call another function (that returns a promise), the latter function will not be executed until the former finishes. This means I'm unable to implement keep alive using the javascript api functions that return a promise.

             

            Also, I tried to manually implement a ping by calling https://hostname/vizportal/api/web/v1/getSessionInfo, but that fails because the domain name I'm calling Tableau server from is different from tableau server's domain name and the browser does not allow a cross-site call unless there are some specific headers set up at the Tableau server host.

             

            Is there anyone who would know if there is any function in the Tableau javascript API that would generate a HTTP request but that would not return a promise (i.e. would be executed immediately) so that I could implement keep alive with that?