Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
mstoler
Partner - Specialist
Partner - Specialist

Qlik Sense .Net SDK Timeout

Hello,

I am using the Qlik Sense .Net SDK to load an Application.

Sometimes when I use the statement below to load an app I get a Timeout Exception.  Is there a way to set the Timeout Value?

ILocation location = Qlik.Engine.Location.FromUri(new Uri(sQlikSenseServer));

location.AsNtlmUserViaProxy(proxyUsesSsl: false);

IAppIdentifier appIdentifer = location.AppWithNameOrDefault(sQlikSenseApplication);

var app = location.App(id);    // This statement sometimes gets a Timeout Exception

Thank You,

1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

Yes, there is a setting for it. You can use this one:

https://help.qlik.com/en-US/sense-developer/February2018/apis/net%20sdk/html/P_Qlik_Sense_JsonRpc_Rp...

It's a static, global property so you can set it directly. If you don't care about timeouts, you could write like this:

JsonRpc.Timeout = Int32.MaxValue;

Another option would be to use the async version of App. That way you can control the timeout behavior yourself:

https://help.qlik.com/en-US/sense-developer/February2018/apis/net%20sdk/html/M_Qlik_Engine_LocationE...

View solution in original post

3 Replies
Øystein_Kolsrud
Employee
Employee

Yes, there is a setting for it. You can use this one:

https://help.qlik.com/en-US/sense-developer/February2018/apis/net%20sdk/html/P_Qlik_Sense_JsonRpc_Rp...

It's a static, global property so you can set it directly. If you don't care about timeouts, you could write like this:

JsonRpc.Timeout = Int32.MaxValue;

Another option would be to use the async version of App. That way you can control the timeout behavior yourself:

https://help.qlik.com/en-US/sense-developer/February2018/apis/net%20sdk/html/M_Qlik_Engine_LocationE...

ar5
Partner - Contributor III
Partner - Contributor III

I am calling the same app multiple times and it gives an exception on the 4th call. "Websocket closed unexpectedly(endpoint unavailable)"
var location = Location.FromUri(_baseUrl);
location.AsJwtViaProxy(token);
IAppIdentifier foundAppIdentifier = location.AppWithNameOrDefault(appName);

using (var app = await location.AppAsync(foundAppIdentifier.AppId)){}

 

//I used debug console and found this:
{
[2024-06-17T18:35:07.055Z] "jsonrpc": "2.0",
[2024-06-17T18:35:07.057Z] "method": "OnMaxParallelSessionsExceeded",
[2024-06-17T18:35:07.059Z] "params": {
[2024-06-17T18:35:07.065Z] "severity": "fatal",
[2024-06-17T18:35:07.067Z] "timestamp": "2024-06-17T18:35:07.0140386Z",
[2024-06-17T18:35:07.068Z] "message": "Access to the app is denied: MaxParallelSessionsExceeded"
[2024-06-17T18:35:07.070Z] }
[2024-06-17T18:35:07.071Z] }

//stack trace

at Qlik.Engine.Communication.QlikConnection.AwaitResponseTask[T](T task, String methodName, CancellationToken cancellationToken)
at Qlik.Engine.Communication.QlikConnection.AwaitResponse(Task task, String methodName, CancellationToken cancellationToken)
at Qlik.Engine.Communication.QlikConnection.Ping()
at Qlik.Sense.JsonRpc.GenericLocation.DisposeOnError(IDisposable o, Action f)
at Qlik.Engine.LocationExtensions.Hub(ILocation location, ISession session)
at Qlik.Engine.LocationExtensions.AppsWithNameOrDefault(ILocation location, String appName)
at Qlik.Engine.LocationExtensions.AppWithNameOrDefault(ILocation location, String appName)

marksouzacosta
Partner - Specialist
Partner - Specialist

This article will probably help you on dealign with this problem: Deal with Qlik Sense Sessions | Qalyptus Blog

Read more at Data Voyagers - datavoyagers.net