Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

WebSocket session closed when calling QRS API

Hi,

I just noticed that something interesting when using Engine API and QRS API together.

Here's the scenario:

- open WebSocket session for Engine API calls (using Java & Tyrus WS implementation)

- call some Engine API method

- make a QRS API call

--> WebSocket session closes just after this !?!? (subsequent Engine API calls will fail)

If I leave out QRS API call, the WS session stays open normally ofc.

Is Qlik closing the WS session when executing the QRS API call?

This feels a bit strange to me. Anyone else has encountered this?

1 Solution

Accepted Solutions
ErikWetterberg

The session is closed by design. If you would reuse the same session for another app you would break the load balancing. You should always open a new session when you open an app, to allow the load balancer to direct you to the correct engine.

Erik

View solution in original post

6 Replies
Not applicable
Author

Just a quick update:

This seems to be the case only if we delete an app via QRS API that we have been creating via Engine API call.

So an improved description of events is as follows:

- open WebSocket session for Engine API calls (using Java & Tyrus WS implementation)

- call "CreateApp" Engine API method

- call "OpenDoc" Engine API method (get handle to created app)

- make a QRS API call (DELETE qrs/app/{id}) (delete the created app)

--> WebSocket session closes just after this (subsequent Engine API calls will fail)

Øystein_Kolsrud
Employee
Employee

Are you deleting the same app that you have just opened? Your WebSocket session will be tied to the app you are connecting to, so if the app is deleted, then it is expected that your WebSocket should close as well. But if you have a WebSocket connection to the hub or another app, then that should remain unaffected.

Not applicable
Author

Yes it is the same app we're deleting. It is used for temporary purposes.

It's a bit shame that it's closing the session in this scenario, I mean one might guess you could do other things that are not related to that app in the same session later on, right?

Ok but anyway, thanks for the answer and I'll refactor our code and move things around to avoid this situation.

ErikWetterberg

The session is closed by design. If you would reuse the same session for another app you would break the load balancing. You should always open a new session when you open an app, to allow the load balancer to direct you to the correct engine.

Erik

Not applicable
Author

Ok thanks Erik.

Not applicable
Author

Hi Tony,

I just that you succeed to connect to Engine API from java using Tyrus WS implemantation.

I'm trying the same thing, but I still have a problem to authenticate my first call (GetDocList).

It return me this : {"jsonrpc":"2.0","method":"OnAuthenticationInformation","params":{"loginUri":"http://qlik:4248/form/?targetId=d73c82b6-3ed6-457f-976b-8729cc89cd80","mustAuthenticate":true}}

Can you help me ?

I try with a qlikTicket and with an another virtual proxy throw static header authentication.

Thank you

Eric