Le user "service" crée des sessions à chaque call API dans l'instance Simplicité source

Bonsoir,
J’ai une instance “front” Simplicité (en 4.0.P25) dans laquelle est configuré un objet service A lié à une autre instance “back” Simplicité (en 5.1) qui héberge l’objet A. Je ne suis pas convaincu que les différences de versions soient en cause.

La consultation en liste ou en formulaire de A fonctionne a priori sans soucis particulier sur les instances “front” et “back”.

L’instance “front” configure par ailleurs des objets métier dont l’un des champs d’objet est un lien de type “Objet” référençant l’objet service A sur “front”. Nous mettons cela en place pour supporter un travail de mapping visant à réconcilier plusieurs listes d’inventaire (des choses A’, A’’, A’’’, etc. devant à terme être assimilées par A) pour ne plus utiliser à terme que l’objet A hébergé dans “back” via ses API). Tant que ces travaux de réconciliation ne sont pas terminés, A’, A’’ ou A’’’ vont continuer d’exister en parallèle de A.

Le problème que je rencontre est lié à la non réutilisation des sessions API crées dans “back” (via un token demandé par “front”). En effet, à chaque appel API de “front” sur “back” (le token obtenu initialement est bien réutilisé a priori), des sessions s’empilent sur “back”. Simplement en parcourant les pages de A’ sur “front”, je suis arrivé jusqu’à plusieurs centaines de sessions initialisées en parallèle sur “back” (20 nouvelles sessions par page de 20 lignes).

J’ai lu et suivi les préconisations afférentes à la prolongation de la durée de vie du token mais ça reste sans effet.

Je vais faire des tests et je te tiens au courant mais ce comportement n’est pas celui prévu.

On parle bien d’images Docker standard pour les deux instances Simplicité en question ?

Bonjour David, oui absolument.
Nous avons le même problème pour les calls API fournissant un token Renault.
Pour ce cas de figure, nous avons contourné le problème en injectant un cookie de session (oui, je sais, :flushed: :sweat: :see_no_evil:) qui assure la réutilisation de la session mais pour le mécanisme interne de communication inter-instance Simplicité nous ne pouvons pas le faire.

J’ai retesté l’affichage d’une simple page de 20 lignes de A sur “front” (donc sans mobiliser a priori la partie du modèle impliquant A’, A’’ et A’’’) et le problème se pose dès ce use case : 20 sessions créées sur “back” suite à l’affichage de cette première page. 20 sessions additionnelles pour chaque page parcourue.

PI il ne faudrait jamais injecter de cookie de session. Il y a un mécanisme “bas niveau” qui re-attache les requêtes API à une session “technique”

Il y a peut être une pb dans votre cas lié au fait qu’on parle d’un token externe.

Entre vos instances c’est de l’appel direct - avec token interne - ou est-ce que ça passe par le broker et donc par un token externe ?

Oui nous avions déjà bien compris ça (on se soigne)…

Par contre, le problème se pose bien dans les deux cas : token Renault ou Simplicité… [EDIT] accès en direct à l’instance “back” depuis l’instance “front” (sans passer par un broker).

Voici quelques éléments de contexte/détail:

Conf de l’objet A dans “front” :


image

User service dans “back” :

Paramètres système dans “back” pouvant avoir un impact à ma connaissance sur la gestion des sessions

Bonjour,

Petite question, est-il possible d’avoir le détail d’un appel (tout le header http avec le token simplicité) en sortie du front et en entrée du back ? pour au moins être sûr qu’il est présent dans chaque appel.

Il y a peut être quelque chose d’incompatible ou qui ne le transmet pas correctement dans simplicité ou dans les couches réseaux.

J’essaye de trouver ça…

Bon, j’ai essayé d’activer des traces en input/output des requests http du tomcat “front” ainsi que le mode DEBUG intern (LOG_DEBUG=yes).

Je n’ai toujours pas le détail des headers échangés entre “front” et “back” mais j’ai déjà récupéré ceci (scénario = affichage de la page 1 de 20 lignes de A depuis “front” qui fait un appel direct à “back” :

2021-09-16 14:52:49,995|SIMPLICITE|http://f91e2ac49101:8080||DEBUG|system|com.simplicite.webapp.servlets.ui.JSONServlet|service||Evénement: Scheme : [http]
Port : [8080]
Hostname : [localhost]
Context path : []
Request URI : [/ui/json/obj]
Request URL : [http://localhost:8080/ui/json/obj]
Query string : [action=search&object=IT4ITProduct&inst=the_ajax_IT4ITProduct&context=2&page=0&inline_documents=infos&inline_thumbnails=true&inline_objects=true&_md=true&_visible=true&_totals=true&_=36fe9199f3b657d8ad9bfda87bcf8a83d12daac2_20210916144924]
Full URL : [http://localhost:8080/ui/json/obj?action=search&object=IT4ITProduct&inst=the_ajax_IT4ITProduct&context=2&page=0&inline_documents=infos&inline_thumbnails=true&inline_objects=true&_md=true&_visible=true&_totals=true&_=36fe9199f3b657d8ad9bfda87bcf8a83d12daac2_20210916144924]
Base URL : [http://localhost:8080]
Method : [POST]
Request encoding : [null]
Request content type : [multipart/form-data; boundary=----WebKitFormBoundaryH9pne3XZfCFRegmr]
Request content length : [44]
Remote address : [172.20.0.1]
Remote host : [172.20.0.1]
Authentication type : [null]
User login : [a068181]
Session : [625343FF56EEBBE31F899711443877E3]
Cookies :
        _clientid = [qRlZtVVOtOLFlpvcjFPJ_1626781335587]
        JSESSIONID = [625343FF56EEBBE31F899711443877E3]
Headers :
        accept = [*/*]
        accept-encoding = [gzip, deflate, br]
        accept-language = [fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7]
        connection = [keep-alive]
        content-length = [44]
        content-type = [multipart/form-data; boundary=----WebKitFormBoundaryH9pne3XZfCFRegmr]
        cookie = [_clientid=qRlZtVVOtOLFlpvcjFPJ_1626781335587; JSESSIONID=625343FF56EEBBE31F899711443877E3]
        host = [localhost:8080]
        origin = [http://localhost:8080]
        referer = [http://localhost:8080/ui]
        sec-ch-ua = ["Google Chrome";v="93", " Not;A Brand";v="99", "Chromium";v="93"]
        sec-ch-ua-mobile = [?0]
        sec-ch-ua-platform = ["Windows"]
        sec-fetch-dest = [empty]
        sec-fetch-mode = [cors]
        sec-fetch-site = [same-origin]
        user-agent = [Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36]
        x-requested-with = [XMLHttpRequest]
Parameters :
        _[0] = [36fe9199f3b657d8ad9bfda87bcf8a83d12daac2_20210916144924]
        _md[0] = [true]
        _totals[0] = [true]
        _visible[0] = [true]
        action[0] = [search]
        context[0] = [2]
        inline_documents[0] = [infos]
        inline_objects[0] = [true]
        inline_thumbnails[0] = [true]
        inst[0] = [the_ajax_IT4ITProduct]
        object[0] = [IT4ITProduct]
        page[0] = [0]

2021-09-16 14:52:49,995|SIMPLICITE|http://f91e2ac49101:8080||DEBUG|system|com.simplicite.webapp.tools.ServletTool|setHTTPHeaders||Evénement: [REQUEST] method POST on /ui/json/obj from 172.20.0.1 with session 625343FF56EEBBE31F899711443877E3, [RESPONSE]  MIME type: application/json; charset=UTF-8 max age: 0 seconds
2021-09-16 14:52:49,995|SIMPLICITE|http://f91e2ac49101:8080||ICORESV001|system|com.simplicite.util.tools.APITool|call||Request to URL: https://int.rfi.dev.aws.renault.com//api/rest/IT4ITProduct?_metadata=true&_metadatacontext=2, method: GET
2021-09-16 14:52:50,441|SIMPLICITE|http://f91e2ac49101:8080||ICORESV001|system|com.simplicite.util.tools.APITool|call||Response: {"id":"1989","name":"IT4ITProduct","instance":"rest_IT4ITProduct","label":"Product","plurallabel":"Product","icon":"object","rowidfield":"row_id","help":"","open":true,"create":true,"copy":true,"update":true,"del":true,"export":true,"print":true,"readonly":false,"accessNewForm":true,"accessNewLoop":true,"selectRows":true,"useForm":true,"fields":[{"id":"1","name":"row_id","type":0,"length":11,"precision":0,"label":"ID","obfId":"","key":false,"required":true,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":0,"searchOrder":0,"area":0,"shortlabel":"","refId":false,"ref":false,"updatable":false,"defaultValue":"0","visible":0},{"id":"8684","name":"it4itProExternIdentifier","type":3,"length":100,"precision":0,"label":"Extern identifier","obfId":"18734","key":true,"required":true,"searchable":1,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":10,"searchOrder":0,"area":1,"shortlabel":"","refId":false,"ref":false,"updatable":true,"visible":3},{"id":"8685","name":"it4itProSource","type":7,"length":10,"precision":0,"label":"Source","obfId":"18735","key":true,"required":true,"searchable":1,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":20,"searchOrder":0,"area":1,"rendering":"SB","shortlabel":"","refId":false,"ref":false,"updatable":true,"visible":3,"listOfValuesName":"IT4IT_SOURCE","listOfValues":[{"code":"IT4IT","index":0,"value":"IT4IT","enabled":true},{"code":"HERMINE","index":1,"value":"Hermine","enabled":true},{"code":"BCSI","index":2,"value":"BCSI","enabled":true},{"code":"PANDA","index":3,"value":"Panda","enabled":true}]},{"id":"8423","name":"it4itGenName","type":3,"length":100,"precision":0,"label":"Name","obfId":"18156","key":false,"required":true,"searchable":1,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":30,"searchOrder":0,"area":1,"shortlabel":"","refId":false,"ref":false,"updatable":true,"visible":3},{"id":"8424","name":"it4itProStatus","type":7,"length":10,"precision":0,"label":"Status","obfId":"18157","key":false,"required":true,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":40,"searchOrder":0,"area":1,"rendering":"SB","shortlabel":"Status","refId":false,"ref":false,"updatable":true,"visible":3,"listOfValuesName":"IT4IT_PRO_STATUS","listOfValues":[{"code":"BACKLOG","index":0,"value":"Backlog","enabled":true},{"code":"IN_USE","index":1,"value":"In use","enabled":true},{"code":"STOPPED","index":2,"value":"Stopped","enabled":true},{"code":"ARCHIVED","index":3,"value":"Archived","enabled":true}]},{"id":"8425","name":"it4itGenDescription","type":13,"length":1000,"precision":0,"label":"Description","obfId":"18158","key":false,"required":false,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":50,"searchOrder":0,"area":1,"shortlabel":"Description","refId":false,"ref":false,"updatable":true,"visible":3},{"id":"8427","name":"it4itProType","type":7,"length":20,"precision":0,"label":"Type","obfId":"18160","key":false,"required":false,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":60,"searchOrder":0,"area":1,"rendering":"SB","shortlabel":"Type","refId":false,"ref":false,"updatable":true,"visible":3,"listOfValuesName":"IT4IT_PRO_TYPE","listOfValues":[{"code":"BUSINESS_PRODUCT","index":0,"value":"Business Product","enabled":true},{"code":"SERVICE","index":1,"value":"Service","enabled":true},{"code":"TECHNICAL_ENABLER","index":2,"value":"Technical Enabler","enabled":true},{"code":"DEPLOYMENT","index":3,"value":"Deployment","enabled":true}]},{"id":"8489","name":"it4itGenFunctionId","type":0,"length":11,"precision":0,"label":"Function","obfId":"18738","key":false,"required":false,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":70,"searchOrder":0,"area":1,"shortlabel":"","refId":true,"ref":false,"refObject":"IT4ITFunction","refLabel":"Function","updatable":true,"visible":3},{"id":"8686","name":"it4itGenFunctionId__it4itFunName","type":3,"length":100,"precision":0,"label":"Function Name","obfId":"18739","key":true,"required":true,"searchable":1,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":80,"searchOrder":0,"area":1,"shortlabel":"","refId":false,"ref":true,"refObject":"IT4ITFunction","refLabel":"Function","refName":"it4itFunName","refField":"it4itGenFunctionId","updatable":false,"visible":3},{"id":"8426","name":"it4itGenCreationDate","type":4,"length":10,"precision":0,"label":"Creation date","obfId":"18159","key":false,"required":true,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":90,"searchOrder":0,"area":1,"shortlabel":"","refId":false,"ref":false,"updatable":true,"visible":3},{"id":"2","name":"created_dt","type":5,"length":19,"precision":0,"label":"Created","obfId":"","key":false,"required":true,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":10000,"searchOrder":0,"area":0,"shortlabel":"","refId":false,"ref":false,"updatable":false,"visible":0},{"id":"3","name":"created_by","type":3,"length":100,"precision":0,"label":"Created by","obfId":"","key":false,"required":true,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":10010,"searchOrder":0,"area":0,"shortlabel":"","refId":false,"ref":false,"updatable":false,"visible":0},{"id":"4","name":"updated_dt","type":5,"length":19,"precision":0,"label":"Updated","obfId":"","key":false,"required":true,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":10020,"searchOrder":0,"area":0,"shortlabel":"","refId":false,"ref":false,"updatable":false,"visible":0},{"id":"5","name":"updated_by","type":3,"length":100,"precision":0,"label":"Updated by","obfId":"","key":false,"required":true,"searchable":0,"searchReq":0,"sort":"C","extended":false,"extList":false,"order":10030,"searchOrder":0,"area":0,"shortlabel":"","refId":false,"ref":false,"updatable":false,"visible":0}],"areas":[{"id":"314","label":"Product","name":"IT4ITProduct-1","icon":"star","area":1,"title":false,"visible":true,"nofield":false,"uiTemplate":"<div>\n  <div class=\"row\">\n    <div class=\"col-sm-4\">\n      <div class=\"field\" data-field=\"it4itProExternIdentifier\"><\/div>\n    <\/div>\n    <div class=\"col-sm-4\">\n      <div class=\"field\" data-field=\"it4itProSource\"><\/div>\n    <\/div>\n    <div class=\"col-sm-4\">\n      <div class=\"field\" data-field=\"it4itProStatus\"><\/div>\n    <\/div>\n  <\/div>\n  <div class=\"row\">\n    <div class=\"col-sm-4\">\n      <div class=\"field\" data-field=\"it4itGenCreationDate\"><\/div>\n    <\/div>\n    <div class=\"col-sm-4\">\n      <div class=\"field\" data-field=\"it4itProType\"><\/div>\n    <\/div>\n    <div class=\"col-sm-4\">\n      <div class=\"field\" data-field=\"it4itFunName\"><\/div>\n    <\/div>\n  <\/div>\n  <div class=\"field\" data-field=\"it4itGenName\"><\/div>\n  <div class=\"field\" data-field=\"it4itGenDescription\"><\/div>\n<\/div>","fields":["it4itProExternIdentifier","it4itProSource","it4itGenName","it4itProStatus","it4itGenDescription","it4itProType","it4itGenFunctionId","it4itGenFunctionId__it4itFunName","it4itGenCreationDate"]}],"listAreas":true,"listSortable":true,"social":{"inline":false,"popup":true,"share":false},"actions":[{"id":"","name":"reload","custom":false,"plus":true,"enabled":true,"listVisible":true,"countRows":0,"formVisible":true,"label":"Reload","showLabel":true,"icon":"reload","confirm":false},{"id":"","name":"prefs","custom":false,"plus":true,"enabled":true,"listVisible":true,"countRows":0,"formVisible":true,"label":"Preferences","showLabel":true,"icon":"listpref","confirm":false},{"id":"","name":"export","custom":false,"plus":true,"enabled":true,"listVisible":true,"countRows":2,"listItemVisible":true,"formVisible":true,"label":"Export","showLabel":true,"icon":"export","confirm":false},{"id":"","name":"addlist","custom":false,"plus":false,"enabled":true,"listVisible":true,"countRows":0,"label":"Create on list","showLabel":true,"icon":"listadd","confirm":false},{"id":"","name":"listedit","custom":false,"plus":false,"enabled":true,"listVisible":true,"countRows":0,"label":"Edit list","showLabel":true,"icon":"listedit","confirm":false},{"id":"","name":"updall","custom":false,"plus":true,"enabled":true,"listVisible":true,"countRows":1,"label":"Bulk update","showLabel":true,"icon":"update","confirm":false},{"id":"","name":"delall","custom":false,"plus":true,"enabled":true,"listVisible":true,"countRows":1,"label":"Delete all","showLabel":true,"icon":"deleteall","confirm":false},{"name":"copydlink","url":"https://int.rfi.dev.aws.renault.com?l=IT4ITProduct","label":"Copy link","icon":"icon_link","plus":true,"enabled":true,"showLabel":true,"listVisible":true}],"printtemplates":[],"links":[],"minrows":20,"maxrows":50,"crosstabs":[],"placemaps":[],"agendas":[]}
2021-09-16 14:52:50,442|SIMPLICITE|http://f91e2ac49101:8080||ICORESV001|system|com.simplicite.util.tools.APITool|call||Request to URL: https://int.rfi.dev.aws.renault.com//api/rest/IT4ITProduct?_count=true, method: GET
2021-09-16 14:52:50,644|SIMPLICITE|http://f91e2ac49101:8080||ICORESV001|system|com.simplicite.util.tools.APITool|call||Response: {"count":540,"page":0,"maxpage":26,"pagesize":20}
2021-09-16 14:52:50,644|SIMPLICITE|http://f91e2ac49101:8080||ICORESV001|system|com.simplicite.util.tools.APITool|call||Request to URL: https://int.rfi.dev.aws.renault.com//api/rest/IT4ITProduct?_page=0, method: GET
2021-09-16 14:52:50,854|SIMPLICITE|http://f91e2ac49101:8080||ICORESV001|system|com.simplicite.util.tools.APITool|call||Response: [{"row_id":"548","it4itProExternIdentifier":"1715","it4itProSource":"HERMINE","it4itGenName":"Industrial Devices","it4itProStatus":"IN_USE","it4itGenDescription":"Industrial Devices UPDATED4","it4itProType":"TECHNICAL_ENABLER","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"549","it4itProExternIdentifier":"1722","it4itProSource":"HERMINE","it4itGenName":"SFW - Middleware Platform","it4itProStatus":"IN_USE","it4itGenDescription":"SFW - Middleware Platform","it4itProType":"TECHNICAL_ENABLER","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"550","it4itProExternIdentifier":"1723","it4itProSource":"HERMINE","it4itGenName":"HDW - Middleware Platform","it4itProStatus":"IN_USE","it4itGenDescription":"HDW - Middleware Platform","it4itProType":"TECHNICAL_ENABLER","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"551","it4itProExternIdentifier":"1724","it4itProSource":"HERMINE","it4itGenName":"NETWORKS - LAN - WAN - LPWAN","it4itProStatus":"IN_USE","it4itGenDescription":"NETWORKS  - LAN - WAN - LPWAN","it4itProType":"TECHNICAL_ENABLER","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"552","it4itProExternIdentifier":"1726","it4itProSource":"HERMINE","it4itGenName":"IOT Data Capture","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to get data from sensors and to send them to any business application","it4itProType":"TECHNICAL_ENABLER","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"553","it4itProExternIdentifier":"1727","it4itProSource":"HERMINE","it4itGenName":"Surveys and checklists support","it4itProStatus":"BACKLOG","it4itGenDescription":"IT components enabling to create checklist or survey questionnaires and to collect the results","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"554","it4itProExternIdentifier":"1729","it4itProSource":"HERMINE","it4itGenName":"E&HSE MCO","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to collect the data measuring the impact of Renault activities on the environment,  the safety level of Renault activities and the data of energy consumption and production.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"555","it4itProExternIdentifier":"1731","it4itProSource":"HERMINE","it4itGenName":"Health, Safety and Environment","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to monitor & report the level of safety of Renault sites, both for persons working in or living around Renault sites. Also gather IT components enabling to declare safety incidents and to manage the resolution process associated.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"556","it4itProExternIdentifier":"1732","it4itProSource":"HERMINE","it4itGenName":"Manufacturing Execution Configuration","it4itProStatus":"BACKLOG","it4itGenDescription":"IT components enabling to document the manufacturing or kitting operations to be done for a given product diversity at a workstation or in a kitting zone.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"557","it4itProExternIdentifier":"1733","it4itProSource":"HERMINE","it4itGenName":"Parts Manufacturing Execution System","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to pilot and control automated and manual manufacturing operations of parts (elementary or sub-assemblies).","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"558","it4itProExternIdentifier":"1734","it4itProSource":"HERMINE","it4itGenName":"Powertrain Manufacturing Execution System","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to pilot and control automated and manual manufacturing operations of power-train components.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"559","it4itProExternIdentifier":"1735","it4itProSource":"HERMINE","it4itGenName":"Vehicle Manufacturing execution System","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to pilot and control automated and manual manufacturing operations of vehicles, for car body welding till tests at end of line, for prototypes and series production","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"560","it4itProExternIdentifier":"1736","it4itProSource":"HERMINE","it4itGenName":"Means Monitoring & Tuning","it4itProStatus":"IN_USE","it4itGenDescription":"IT components to monitor the functional state of industrial equipments& to adjust their functional parameters. \nIT components enabling to predict future dysfunction of industrial equipments and to alert on any dysfunction.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"561","it4itProExternIdentifier":"1738","it4itProSource":"HERMINE","it4itGenName":"Personnel Safety Management","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to inform employees and sub-contractors about the safety risks existing in Renault Group sites, to manage the associated risk-management procedures and to control the application of these procedures.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"562","it4itProExternIdentifier":"1739","it4itProSource":"HERMINE","it4itGenName":"Plant & Tools Maintenance Execution","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling the execution preventively or correctively of the actions needed on industrial equipments to raise their functioning to the prescribed or best-possible level","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"563","it4itProExternIdentifier":"1740","it4itProSource":"HERMINE","it4itGenName":"Plant Energetical Performance Control","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to manage the consumption and the production of energy in an industrial site.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"564","it4itProExternIdentifier":"1743","it4itProSource":"HERMINE","it4itGenName":"SAP platform","it4itProStatus":"IN_USE","it4itGenDescription":"IT components, provided by SAP, to support the needs of multiple business domains. SAP instances RACINE and SAP(AMER) are examples of SAP platforms","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"565","it4itProExternIdentifier":"1745","it4itProSource":"HERMINE","it4itGenName":"Team Management - Manufacturing","it4itProStatus":"BACKLOG","it4itGenDescription":"DI-RF Manufacturing service provided by the staff that manages teams, domains, chapters and departments","it4itProType":"SERVICE","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"566","it4itProExternIdentifier":"1748","it4itProSource":"HERMINE","it4itGenName":"Vehicle Electronics Setup And Control Execution","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to setup embarked computer units in vehicles and to check their correct functioning.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"3","it4itGenFunctionId__it4itFunName":"Manufacturing","it4itGenCreationDate":"2019-11-06"},{"row_id":"567","it4itProExternIdentifier":"1750","it4itProSource":"HERMINE","it4itGenName":"Vehicle Electronics Setup And Control Definition","it4itProStatus":"IN_USE","it4itGenDescription":"IT components enabling to define how the embarked computer units in vehicles shall be setup and to checked during manufacturing.","it4itProType":"BUSINESS_PRODUCT","it4itGenFunctionId":"4","it4itGenFunctionId__it4itFunName":"Production Enginering","it4itGenCreationDate":"2019-11-06"}]
2021-09-16 14:52:50,857|SIMPLICITE|http://f91e2ac49101:8080||WARN|a068181|com.simplicite.objects.BCSIModule_DigitalAsset.IT4ITProduct|getUserKeyLabel||Evénement: Industrial Devices [HERMINE:1715]
2

La valve qui gère la session “technique” API est subtile car elle gère de nombreux cas. On doit être dans un cas particulier pas bien géré.

NB: En 5.2 on a refactoré tout ça pour qu’il n’y ait plus de session au sens Tomcat, même “technique”, sur le endpoint API (donc plus besoin de cette valve). C’est pas encore assez sec et de toute façon trop impactant pour envisager de backporter ça en 5.1 et à fortiori en 4.0.

J’ai monté un environnement de test avec une instance “front” en 4.0 à jour et une instance “back” en 5.1 à jour

Sur la “back” j’ai installé la démo et sur la “front” j’ai configuré un objet remote qui pointe sur l’objet supplier de l’instance “back”

Dans cette configuration, la consultation (affichage de listes, formulaires) de l’objet remote sur “front” ne multiplie pas les sessions sur “back”.

Pas non plus en faisant des appels curl directs sur le back.

Il y a, je pense, des choses plus spécifiques dans ton cas => je vais creuser…

Merci David,
le cas particulier est peut-être que A (objet hébergé par “back” et objet service dans “front” est référencé dans le modèle d’autres objets A’, A’’, A’’’ de “front” comme champ d’objet de type “Objet Simplicité”…


Mon analyse

Seul le cookie tomcat JSESSIONID est présent alors que USE_USERTOKENS = all
et donc Simplicité utilise également le cookie SIMPLICITE_USERTOKEN qui doit présent dans tous les appels.

Le JSESSIONID permet de rester dans la session tomcat tant que les appels sont avant son temps expiration (court), ensuite en cas de nouvel appel grâce au SIMPLICITE_USERTOKEN en base, Simplicité peut retrouver la session (longue) encore valide, et la rattacher à la nouvelle session tomcat.

Bref à mon avis, il doit y avoir un soucis dans le header de cet appel d’objet-service (si le réseau ne filtre pas les cookies, et quand USE_USERTOKENS = all).

Attention, sur le endpoint API il y a une valve qui gère de manière transparent la réaffectation des requêtes à une session “technique” unique. Sur le endpoint API il ne faut donc pas se soucier ou forcer du JSESSIONID, au risque de compromettre ce qu’est sensé faire la valve

NB: Les objets remote passent par le endpoint API (pas par des mécanismes UI).

@bmo, je viens de faire le test avec un objet sur “front” avec un attribut de type “objet” qui pointe sur le remote object “back” => pas de multiplication de session (ou de token) non plus.

Autant via votre broker il n’est peut être pas impossible qu’il y ait un effet de bord non prévu lié à l’utilisation d’un token externe et/ou un forçage de JSESSIONID, autant en mode remote object direct avec token interne je ne vois vraiment pas de raison que ça pose pb (sauf si vos images custom inhibent la fameuse valve mais je ne pense pas). En tout cas je n’ai visiblement pas de pb de multiplication de session dans mes tests dans ce cas d’usage…

Oui, je ne sais plus trop comment la valve se comporte, mais elle utilise nécessairement quelque chose du header pour retrouver sa session “unique”.

Si ce n’est pas un cookie comme en V5, c’est un autre champ :
x-simplicite-authorization, authorization bearer…

Il n’y a rien de cet ordre dans l’appel indiqué par Bruno plus haut, juste un JSESSIONID.
mais bon ce n’est peut être pas la bonne requête à regarder ni les bons prérequis pour cette valve à chercher.

Bonjour François,
en fait, le détail que j’ai réussi à récupérer porte sur le scénario suivant:

  1. le navigateur requête l’objet A’ sur “front”
  2. l’objet A’ sur “front” requête l’objet service A sur “front” via sa foreign key de type “Object”
  3. l’objet service A sur “front” requête l’objet A sur “back”

Les étapes 1 et 2 mobilisent le endpoint /ui/obj sur “front” alors que l’étape 3 mobilise le endpoint “/api/rest” sur “back”. Je n’arrive pas à tracer les headers fournis à APITool pour requêter A sur “back” via “/api/rest”… (ça dépasse mes compétences / mon champ d’action sur nos moyens…)

La valve est un composant technique assez bête => pour tout appel sur /api/* elle réaffecte la requête sur une session unique “technique” (qui n’expire jamais). Elle ne s’occupe de rien d’autre (en particulier elle ne s’occupe pas du token car ça c’est géré applicativement, cf ci-dessous)

La mécanique de gestion des grants dans cette session “technique” n’a rien à voir avec la logique UI où une session = un grant.

Cette session “technique” gère un cache de N grants API isolés, elle retrouve le bon (ou le (re)créé si besoin) en fonction du token passé dans le header [X-Simplicite-]Authorization: Bearer <token>.

Et, pour mémoire, au sein de chacun de ces grants API, on gère des pools d’objets métier (pour gérer le cas où N clients utiliseraient simultanément le même token pour faire des requêtes sur le même objet métier).

Bref ce qui se passe au niveau du endpoint API (et sa session “technique” unique routée par la valve) est très différent de ce qui se passe sur une session UI mono utilisateur.

PS: et en 5.2 on enfin pu abandonner la session “technique” unique API au profit du servlet context, du coup plus besoin de la valve.