Code Monkey home page Code Monkey logo

Comments (5)

t-ostrowski avatar t-ostrowski commented on September 10, 2024 1

I think that my issue is also network related, so I'm closing this issue until I can dig deeper on what is going on.
Thank you for your help!

from enigma.js.

axelssonHakan avatar axelssonHakan commented on September 10, 2024

If you connect through the Qlik Sense Proxy there is a maximum of 5 concurrent sessions. Best would be to connect directly to the engine using certificates. It would also be recommended to open the apps without data to open each app faster (if not already loaded into the engine memory).
https://qlik.dev/apis/json-rpc/qix/global#%23%2Fentries%2FGlobal%2Fentries%2FOpenDoc >> qNoData

from enigma.js.

t-ostrowski avatar t-ostrowski commented on September 10, 2024

Thank you for your feedback!
When I use the session cookie, I sometimes manage to edit more than 70 apps, so I figured that it was not the problem...
I will look into connecting directly to the engine, and that qNoData parameter.

from enigma.js.

axelssonHakan avatar axelssonHakan commented on September 10, 2024

Not sure how the virtual proxy is configured but looking at the console.log from your example it seems that the cookies have to do with AWS load balancer? If you set the JWT as authentication Bearer you don't need to worry about cookies.

Also if you want to connect through the proxy you could use something like bluebirds concurrency

const enigma = require('enigma.js');
const WebSocket = require('ws');
const Promise = require('bluebird');
const schema = require('enigma.js/schemas/12.20.0.json');

const config = {
  schema,
  url: 'ws://localhost:9076/app/',
  createSocket: (url) => new WebSocket(url),
}

const session = enigma.create(config);

(async () => {
  const global = await session.open();
  const apps = await global.getDocList();
  session.close();

  let infos = await Promise.map(apps, async appElm => {
    return await getDocInfo(appElm.qDocName);
  }, {concurrency: 4}); // Using 4 concurrent sessions to be safe 

  console.log("INFOS:", infos);

})().catch(err => {
  console.error(err);
});

const getDocInfo = async (appName) => {
  let localconfig = { ...config };
  localconfig.url += `${encodeURIComponent(appName)}`

  const localSession = await enigma.create(localconfig)
  const localGlobal = await localSession.open();
  const app = await localGlobal.openDoc(appName);
  const appInfo = await app.getAppProperties();
  localSession.close();

  return appInfo;
}

from enigma.js.

axelssonHakan avatar axelssonHakan commented on September 10, 2024

@ostroluge - were you able to solve your issues? Could we close this issue?

from enigma.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.